/* Responsive Design Styles */

/* Mobile First Approach */

/* Base styles are for mobile devices */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .col-md-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }

    .hero h1 {
        font-size: 3.5rem;
    }

    .creator-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .col-lg-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-lg-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }

    .hero h1 {
        font-size: 4rem;
    }

    .creator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .col-xl-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-xl-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .navbar {
        position: relative;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .navbar-nav.show {
        display: flex;
    }

    .navbar-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    .navbar-actions {
        gap: 0.5rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero .btn {
        display: block;
        margin: 0.5rem auto;
        max-width: 280px;
    }

    .creator-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .creator-card {
        padding: 1.5rem 1rem;
    }

    .categories {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .card-body {
        padding: 1rem;
    }

    /* Mobile form adjustments */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Mobile table */
    .table-responsive {
        overflow-x: auto;
    }

    .table {
        min-width: 600px;
    }

    /* Hide elements on mobile */
    .d-none-mobile {
        display: none;
    }

    .d-block-mobile {
        display: block;
    }

    /* Mobile spacing */
    .mb-mobile-2 { margin-bottom: 0.5rem; }
    .mb-mobile-3 { margin-bottom: 1rem; }
    .mt-mobile-2 { margin-top: 0.5rem; }
    .mt-mobile-3 { margin-top: 1rem; }
}

/* Desktop only */
@media (min-width: 769px) {
    .navbar-toggle {
        display: none;
    }

    .d-none-desktop {
        display: none;
    }

    .d-block-desktop {
        display: block;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .navbar,
    .dropdown-menu {
        display: none !important;
    }

    body {
        font-size: 12px;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }

    .card {
        border: 1px solid #000;
        box-shadow: none;
    }

    a {
        text-decoration: none;
        color: #000;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid;
    }

    .form-control {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .form-control {
        min-height: 44px;
    }

    .dropdown-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Landscape phone optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .navbar {
        padding: 0.5rem 0;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .creator-card {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .card-body {
        padding: 0.75rem;
    }
}

/* Large screens optimizations */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero h1 {
        font-size: 4.5rem;
    }

    .creator-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Specific component responsive behaviors */

/* Modal responsiveness */
@media (max-width: 768px) {
    .modal {
        padding: 0 1rem;
    }

    .modal-content {
        margin: 1rem 0;
        width: 100%;
        max-width: none;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }
}

/* Dashboard responsiveness */
@media (max-width: 768px) {
    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: transform 0.3s ease;
    }

    .dashboard-sidebar.show {
        transform: translateX(280px);
    }

    .dashboard-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1049;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Data tables responsiveness */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: block;
        border: 1px solid #e5e7eb;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    .data-table tbody td {
        display: block;
        text-align: left;
        padding: 0.5rem 1rem;
        border-bottom: 1px solid #f3f4f6;
    }

    .data-table tbody td:last-child {
        border-bottom: none;
    }

    .data-table tbody td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #374151;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    .sr-only-mobile {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Focus indicators for touch */
    button:focus,
    a:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid #2563eb;
        outline-offset: 2px;
    }
}
