/* ============================================================
   NSVAIR Alumni Portal - Responsive Styles
   Breakpoints: 1200px, 992px, 768px, 576px
   ============================================================ */

/* ---- Large Desktop ---- */
@media (max-width: 1400px) {
    .hero-visual {
        width: 420px;
        height: 420px;
    }
}

/* ---- Desktop ---- */
@media (max-width: 1200px) {
    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-visual {
        width: 380px;
        height: 380px;
        right: 2%;
    }

    .hero-stats {
        gap: var(--space-6);
    }
}

/* ---- Tablet / Small Desktop ---- */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-fixed) - 1);
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .top-header {
        left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .hero-visual {
        display: none;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-items: center;
    }

    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .landing-nav-links {
        display: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
}

/* ---- Tablet Portrait ---- */
@media (max-width: 768px) {
    .page-content {
        padding: var(--space-6) var(--space-4);
    }

    .hero-section {
        padding: var(--space-16) var(--space-6);
        min-height: auto;
        padding-top: 120px;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }

    .hero-stat-value {
        font-size: var(--text-2xl);
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
        padding: var(--space-6);
    }

    .stat-card .stat-value {
        font-size: var(--text-3xl);
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .directory-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-details {
        justify-content: center;
    }

    .data-table-wrapper {
        margin: 0 calc(-1 * var(--space-4));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .modal-content {
        max-width: 100%;
        margin: var(--space-4);
    }

    .section-header {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }

    .landing-nav {
        padding: var(--space-3) var(--space-4);
    }

    .features-section,
    .institutions-section,
    .cta-section {
        padding: var(--space-16) var(--space-4);
    }

    .header-search .input-field {
        width: 200px;
    }
}

/* ---- Mobile ---- */
@media (max-width: 576px) {
    html {
        font-size: 15px;
    }

    .hero-section {
        padding-top: 100px;
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .directory-grid {
        grid-template-columns: 1fr;
    }

    .library-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .page-content {
        padding: var(--space-4) var(--space-3);
    }

    .login-left {
        padding: var(--space-6) var(--space-3);
    }

    .auth-card {
        padding: var(--space-5);
    }

    .tabs {
        flex-direction: column;
    }

    .header-search {
        display: none;
    }

    .header-right .btn {
        display: none;
    }

    .top-header {
        padding: 0 var(--space-4);
    }

    .top-header h2 {
        font-size: var(--text-base);
    }

    .toast-container {
        left: var(--space-3);
        right: var(--space-3);
        top: var(--space-3);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 85vh;
    }
}

/* ---- Page-specific Responsive Rules ---- */

/* Mentorship page */
@media (max-width: 768px) {
    .mentorship-grid {
        grid-template-columns: 1fr;
    }

    .flex-between {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .page-header-text {
        width: 100%;
    }

    .page-header-text+div {
        width: 100%;
        display: flex;
        gap: var(--space-2);
    }

    .page-header-text+div .btn {
        flex: 1;
    }

    /* Mentorship requests modal: stack columns */
    .modal-body [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Directory page responsive */
@media (max-width: 576px) {
    .row>.col-md-6.col-lg-4.col-xl-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .row>.col-md-6.col-lg-4.col-xl-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Business Directory responsive */
@media (max-width: 768px) {
    .row>.col-md-6.col-lg-4.mb-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ---- Print Styles ---- */
@media print {

    .sidebar,
    .top-header,
    .toast-container,
    .hamburger-btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .card,
    .stat-card,
    .glass-card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}