/**
 * Vesac India - Responsive Stylesheet
 * Mobile-First Design Approach
 * Updated: February 2, 2026
 */

/* ===== Mobile Adjustments (Small Devices) ===== */
@media (max-width: 480px) {
    
    /* Typography Adjustments */
    h1 {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Navigation */
    .navbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .navbar-brand {
        font-size: 20px;
        width: 100%;
    }
    
    .navbar ul {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .navbar a {
        padding: 8px 12px;
        display: block;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding-left: 12px;
    }
    
    .navbar a:hover,
    .navbar a.active {
        border-bottom: none;
        border-left-color: var(--accent);
    }
    
    /* Section Padding */
    .section {
        padding: 32px 16px;
    }
    
    .section-hero {
        padding: 40px 16px;
    }
    
    .section-hero h1 {
        font-size: 28px;
    }
    
    .section-hero p {
        font-size: 14px;
    }
    
    /* Buttons */
    .btn,
    button {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn + .btn {
        margin-top: 8px;
    }
    
    /* Grid System */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Forms */
    input,
    textarea,
    select {
        font-size: 16px;
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .card-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    /* Footer */
    .footer {
        padding: 24px 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
    
    .footer-section h4 {
        margin-bottom: 8px;
    }
    
    /* Containers */
    .container {
        padding: 0 12px;
    }
    
    /* Tables */
    table {
        font-size: 12px;
    }
    
    /* Utilities */
    .d-none-mobile {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
}

/* ===== Tablet Adjustments (Medium Devices) ===== */
@media (min-width: 481px) and (max-width: 768px) {
    
    /* Typography */
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 26px;
    }
    
    h3 {
        font-size: 20px;
    }
    
    p {
        font-size: 15px;
    }
    
    /* Navigation */
    .navbar {
        padding: 14px 24px;
    }
    
    .navbar ul {
        gap: 12px;
    }
    
    .navbar a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Section Padding */
    .section {
        padding: 48px 24px;
    }
    
    .section-hero {
        padding: 48px 24px;
    }
    
    .section-hero h1 {
        font-size: 32px;
    }
    
    /* Grid System */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Buttons */
    .btn,
    button {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    /* Forms */
    input,
    textarea,
    select {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* Cards */
    .card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    /* Footer */
    .footer {
        padding: 32px 24px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Containers */
    .container {
        padding: 0 20px;
    }
    
    /* Admin Sidebar */
    .admin-sidebar {
        width: 100%;
        height: auto;
        float: none;
        margin-bottom: 12px;
    }
    
    .admin-sidebar a {
        display: inline-block;
        padding: 8px 12px;
        margin: 0 4px;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 16px;
    }
}

/* ===== Desktop Adjustments (Large Devices) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    
    /* Navigation */
    .navbar {
        padding: 15px 32px;
    }
    
    /* Section Padding */
    .section {
        padding: 64px 32px;
    }
    
    .section-hero {
        padding: 64px 32px;
    }
    
    /* Grid System */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Containers */
    .container {
        max-width: 960px;
    }
}

/* ===== Extra Large Screens ===== */
@media (min-width: 1025px) {
    
    /* Navigation */
    .navbar ul {
        flex-direction: row;
    }
    
    .navbar a {
        border-bottom: 2px solid transparent;
        padding: 8px 16px;
    }
    
    .navbar a:hover {
        border-bottom-color: var(--accent);
    }
    
    /* Grid System */
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 28px;
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Containers */
    .container {
        max-width: 1200px;
    }
    
    .admin-sidebar {
        width: 200px;
        height: 100vh;
        float: left;
    }
    
    .admin-content {
        margin-left: 200px;
    }
}

/* ===== Orientation-Specific Styles ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .section-hero {
        padding: 20px 24px;
    }
    
    .section-hero h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .navbar {
        padding: 8px 16px;
    }
}

/* ===== High Resolution Displays (Retina) ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high-DPI displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #1a1a1a;
        --text: #e0e0e0;
        --text-light: #b0b0b0;
    }
    
    body {
        background: #0f0f0f;
        color: var(--text);
    }
    
    .navbar {
        background: #1a1a1a;
        box-shadow: var(--shadow-md);
    }
    
    .card {
        background: #2a2a2a;
    }
    
    input,
    textarea,
    select {
        background: #2a2a2a;
        color: var(--text);
        border-color: #404040;
    }
}

/* ===== 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;
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .footer,
    .no-print,
    button,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

/* ===== Utility Classes for Responsive Design ===== */
.d-none-mobile {
    display: none;
}

.d-none-tablet {
    display: block;
}

.d-none-desktop {
    display: block;
}

@media (min-width: 769px) {
    .d-none-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .d-none-tablet {
        display: none;
    }
}

@media (min-width: 1025px) {
    .d-none-desktop {
        display: none;
    }
}

/* ===== Flexible Typography ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 1025px) {
    html {
        font-size: 16px;
    }
}

/* ===== Flex and Grid Responsive Helpers ===== */
.flex-col-mobile {
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .flex-col-mobile {
        flex-direction: row;
    }
}

.grid-auto-mobile {
    grid-template-columns: 1fr;
}

@media (min-width: 769px) {
    .grid-auto-mobile {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* ===== Floating Action Button Responsive ===== */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

@media (max-width: 480px) {
    .fab {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* ===== Sticky Header Adjustment ===== */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 999;
    }
}