/* Mobile-First CSS for Derma System */
/* Dedicated mobile optimizations and fixes */

/* Mobile Viewport and Base Settings */
@media (max-width: 1200px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .hero-section,
    .page-header {
        padding: 60px 0;
    }
    
    /* Single line side-by-side button layout for mobile/tablet */
    .d-flex.flex-column {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .d-flex.flex-column .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.flex-column .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Video Call Registration Section */
    .dermatologist-list .card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        cursor: pointer;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .dermatologist-list .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0, 86, 179, 0.3);
    }
    
    .dermatologist-list .card.selected {
        border: 2px solid #007bff;
        box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
    }
    
    .dermatologist-list .card-img-top {
        height: 200px;
        object-fit: cover;
    }
    
    .rating {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    
    .payment-option {
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 20px;
        transition: all 0.3s ease;
        background: white;
    }
    
    .payment-option:hover {
        border-color: #007bff;
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
        transform: translateY(-2px);
    }
    
    .payment-option.selected {
        border-color: #007bff;
        background: rgba(0, 123, 255, 0.05);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
    }
    
    .payment-summary {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border: 1px solid #dee2e6;
        border-radius: 12px;
    }
    
    .payment-summary h5 {
        color: #495057;
        font-weight: 600;
    }
    
    .payment-summary .d-flex {
        font-size: 0.95rem;
    }
    
    .payment-summary .fw-bold {
        font-size: 1.1rem;
        color: #007bff;
    }
    
    .form-control:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        border: none;
        transition: all 0.3s ease;
    }
    
    .btn-primary:hover {
        background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    }
    
    .btn-success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        border: none;
        transition: all 0.3s ease;
    }
    
    .btn-success:hover {
        background: linear-gradient(135deg, #20c997 0%, #198754 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    }
    
    .badge {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        font-weight: 500;
    }
    
    .form-check-input:checked {
        background-color: #007bff;
        border-color: #007bff;
    }
    
    .form-check-input:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
        0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
        70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
        100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
    }
    
    .social-icon:hover {
        transform: scale(1.1);
        box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    }
}

/* Tablet Optimizations */
@media (max-width: 992px) {
    /* Navigation */
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(67, 97, 238, 0.1);
        transform: translateX(5px);
    }
    
    /* Hero Section */
    .hero-section {
        padding: 80px 0 60px;
        min-height: auto;
    }
    
    .hero-content {
        text-align: center;
        padding: 0 1rem;
    }
    
    .hero-image {
        margin-top: 2rem;
        text-align: center;
    }
    
    /* Cards Layout */
    .row.g-4 > [class*="col-"] {
        margin-bottom: 1.5rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    /* Testimonials */
    .testimonial-carousel {
        padding: 0 2rem;
    }
    
    /* Contact Form */
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    /* Footer */
    footer {
        padding: 3rem 0 2rem;
    }
    
    footer .row > div {
        margin-bottom: 2rem;
    }
}

/* Mobile Phone Optimizations */
@media (max-width: 768px) {
    /* Base Typography */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
    
    /* Navigation */
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-logo {
        height: 40px !important;
        margin-bottom: 0.25rem;
    }
    
    .brand-text {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 60px 0 40px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .feature-card,
    .service-card,
    .testimonial-card,
    .team-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .feature-icon,
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        margin: 0 auto 1rem;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        padding: 0.875rem 1rem;
        font-size: 16px;
        border-radius: 8px;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 8px;
        font-weight: 600;
    }
    
    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    /* Tables */
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .table {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
    }
    
    /* Stats Cards */
    .stats-card {
        padding: 1.5rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-label {
        font-size: 0.9rem;
        color: #6c757d;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.75rem;
    }
    
    .gallery-card {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .gallery-image-container {
        height: 180px;
    }
    
    .gallery-info {
        padding: 0.75rem;
    }
    
    .gallery-info h5 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .gallery-info p {
        font-size: 0.8rem;
        margin: 0;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .testimonial-author {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .author-avatar {
        width: 60px;
        height: 60px;
    }
    
    /* Team Section */
    .team-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    .team-image {
        width: 100px;
        height: 100px;
        margin: 0 auto 1rem;
    }
    
    /* Contact Section */
    .contact-form-card,
    .contact-info-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 2.5rem 0 1.5rem;
        text-align: center;
    }
    
    footer h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    footer .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    /* Pagination */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 36px;
        min-height: 36px;
    }
}

/* Small Mobile Phones */
@media (max-width: 576px) {
    /* Container */
    .container,
    .container-fluid {
        padding: 0 10px;
    }
    
    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    
    /* Navigation */
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .header-logo {
        height: 35px !important;
    }
    
    .brand-text {
        font-size: 0.8rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 50px 0 30px;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .hero-content .lead {
        font-size: 0.95rem;
    }
    
    /* Cards */
    .card-body {
        padding: 1rem;
    }
    
    .feature-card,
    .service-card,
    .testimonial-card,
    .team-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .feature-icon,
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        padding: 0.75rem 0.875rem;
        font-size: 16px;
        min-height: 40px;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Tables */
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Stats */
    .stats-card {
        padding: 1rem;
    }
    
    .stats-number {
        font-size: 1.75rem;
    }
    
    .stats-label {
        font-size: 0.85rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .gallery-image-container {
        height: 150px;
    }
    
    .gallery-info {
        padding: 0.5rem;
    }
    
    .gallery-info h5 {
        font-size: 0.85rem;
    }
    
    .gallery-info p {
        font-size: 0.75rem;
    }
    
    /* Team */
    .team-image {
        width: 80px;
        height: 80px;
    }
    
    /* Contact */
    .contact-form-card,
    .contact-info-card {
        padding: 1rem;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0 1rem;
    }
    
    footer h5 {
        font-size: 1rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }
}

/* Ultra Small Mobile */
@media (max-width: 480px) {
    /* Hero Section */
    .hero-section {
        padding: 40px 0 25px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content .lead {
        font-size: 0.9rem;
    }
    
    /* Cards */
    .feature-card,
    .service-card,
    .testimonial-card,
    .team-card {
        padding: 0.75rem;
    }
    
    .feature-icon,
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        padding: 0.625rem 0.75rem;
        min-height: 36px;
    }
    
    /* Gallery */
    .gallery-image-container {
        height: 120px;
    }
    
    /* Stats */
    .stats-number {
        font-size: 1.5rem;
    }
    
    /* Team */
    .team-image {
        width: 70px;
        height: 70px;
    }
    
    /* Contact */
    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0 25px;
        min-height: auto;
    }
    
    .hero-content {
        margin-bottom: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .navbar {
        padding: 0.375rem 0.75rem;
    }
    
    .feature-card,
    .service-card,
    .testimonial-card,
    .team-card {
        padding: 1rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .btn:hover,
    .card:hover,
    .feature-card:hover,
    .service-card:hover,
    .testimonial-card:hover,
    .team-card:hover,
    .gallery-card:hover,
    .navbar-nav .nav-link:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Add active states for touch feedback */
    .btn:active {
        transform: scale(0.95);
    }
    
    .card:active,
    .feature-card:active,
    .service-card:active,
    .testimonial-card:active,
    .team-card:active,
    .gallery-card:active {
        transform: scale(0.98);
    }
    
    .navbar-nav .nav-link:active {
        transform: scale(0.95);
        background: rgba(67, 97, 238, 0.1);
    }
    
    /* Increase touch targets */
    .btn,
    .nav-link,
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    /* Better spacing for touch */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp image rendering */
    img,
    .header-logo,
    .gallery-image,
    .team-image img,
    .author-avatar img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: pixelated;
    }
    
    /* Sharper borders */
    .card,
    .btn,
    .form-control,
    .navbar {
        border-width: 0.5px;
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* Prevent zoom on input focus */
    .form-control,
    .form-select {
        font-size: 16px;
        transform: scale(1);
    }
    
    /* Fix viewport height */
    .hero-section {
        min-height: -webkit-fill-available;
    }
    
    /* Fix safe area */
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Android Chrome Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Prevent text selection issues */
    .btn,
    .nav-link {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Fix scroll performance */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Small Screen Optimizations */
@media (max-width: 360px) {
    .container,
    .container-fluid {
        padding: 0 8px;
    }
    
    .hero-content h1 {
        font-size: 1.4rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .feature-card,
    .service-card,
    .testimonial-card,
    .team-card {
        padding: 0.5rem;
    }
    
    .feature-icon,
    .service-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Print Styles for Mobile */
@media print and (max-width: 768px) {
    .navbar,
    .footer,
    .btn,
    .hero-buttons {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .hero-section {
        padding: 1rem 0;
    }
}
