/* ================================================
   RESPONSIVE DESIGN
   Mobile-first approach
   ================================================ */

/* ================================================
   TABLETS (768px and up)
   ================================================ */

@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    h3 {
        font-size: 2rem;
    }
    
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .section-padding {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* ================================================
   DESKTOPS (1024px and up)
   ================================================ */

@media (min-width: 1024px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .section-padding {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
}

/* ================================================
   LARGE DESKTOPS (1200px and up)
   ================================================ */

@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1440px;
    }
}

/* ================================================
   SMALL DEVICES (max 576px)
   ================================================ */

@media (max-width: 575.98px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .navbar {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .section-padding {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .grid-2-col {
        grid-template-columns: 1fr;
    }
    
    .grid-3-col {
        grid-template-columns: 1fr;
    }
    
    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hide sidebar on mobile */
    .sidebar {
        margin-top: 2rem;
    }
    
    /* Collapse navigation */
    .navbar-collapse {
        padding-top: 1rem;
    }
    
    /* Full width modals */
    .modal-dialog {
        margin: 0;
    }
    
    .modal-content {
        border-radius: 1rem 1rem 0 0;
    }
    
    /* Responsive tables */
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* ================================================
   LANDSCAPE MODE (Mobile)
   ================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .section-padding {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    footer {
        display: none;
    }
}

/* ================================================
   TOUCH DEVICES
   ================================================ */

@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .btn {
        padding: 0.75rem 1.5rem;
        min-height: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ================================================
   DARK MODE ADJUSTMENTS
   ================================================ */

@media (prefers-color-scheme: dark) {
    [data-theme="dark"] {
        --background-color: #1F2937;
        --text-color: #F3F4F6;
        --border-color: #374151;
        --light-gray: #374151;
        --dark-gray: #9CA3AF;
    }
}

/* ================================================
   REDUCED MOTION
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================
   HIGH CONTRAST MODE
   ================================================ */

@media (prefers-contrast: more) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
}

/* ================================================
   PRINT MEDIA
   ================================================ */

@media print {
    body {
        background: white;
        color: #000;
        font-size: 12pt;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .btn {
        border: 1px solid #000;
    }
    
    .page-break {
        page-break-after: always;
    }
}

/* ================================================
   GRID LAYOUTS
   ================================================ */

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-3-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3-col {
        grid-template-columns: 1fr;
    }
}

.grid-4-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .grid-4-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-4-col {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   FLEXBOX UTILITIES
   ================================================ */

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.gap-4 {
    gap: 2rem;
}
