/* 
 * HUSNA PORTAL - Premium SaaS UI/UX Design System 
 * Inspired by modern aesthetics (Stripe, Linear, Apple)
 */

:root {
    /* Color Palette */
    --primary: #0F766E;
    --primary-hover: #115E59;
    --secondary: #2563EB;
    --accent: #F59E0B;
    
    /* Backgrounds */
    --bg-main: #F8FAFC;
    --bg-card: rgba(255, 255, 255, 0.85);
    
    /* Text */
    --text-main: #1E293B;
    --text-muted: #64748B;
    
    /* UI Elements */
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(51, 65, 85, 0.8);
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.7);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    z-index: 1000;
    overflow-y: auto;
    transition: transform var(--transition-fast);
}

.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Navigation Links */
.nav-link-custom {
    color: var(--text-muted);
    padding: 12px 24px;
    display: block;
    text-decoration: none !important;
    transition: all var(--transition-fast);
    border-left: 4px solid transparent;
    font-weight: 500;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--primary) !important;
    background: rgba(15, 118, 110, 0.05);
    border-left-color: var(--primary);
}

.nav-link-custom i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

/* Topbar Header */
.topbar {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white !important;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
    transition: all var(--transition-fast);
    text-decoration: none !important;
    display: inline-block;
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3);
    color: white !important;
}

/* Inputs */
.form-control-custom {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 12px 16px;
    transition: all var(--transition-fast);
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    background-color: transparent;
    color: var(--text-main);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.text-muted-custom {
    color: var(--text-muted) !important;
}

/* Auth Layout Specific */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Background blob decorations for SaaS feel */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
}

.bg-blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.bg-blob-2 {
    bottom: -10%;
    right: -10%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

/* ============================================================
   HUSNA OFFICIAL BRANDING DESIGN SYSTEM (DESKTOP DEFAULT)
   ============================================================ */

.brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .brand-logo-container {
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-logo-sidebar {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

/* Responsive Auth Branding Hierarchy (Logo + Title Ratio) */
:root {
    --auth-logo-size: clamp(56px, 4.5vw + 36px, 76px);
    --auth-logo-container-padding: clamp(5px, 0.5vw + 4px, 8px);
    --auth-logo-container-radius: clamp(10px, 0.8vw + 8px, 14px);
    --auth-logo-gap: clamp(0.75rem, 1.2vw + 0.4rem, 1rem);
    --auth-title-size: clamp(1.35rem, 1.2vw + 0.95rem, 1.65rem);
    --auth-title-gap: clamp(0.2rem, 0.4vw + 0.1rem, 0.35rem);
    --auth-subtitle-size: clamp(0.8125rem, 0.3vw + 0.72rem, 0.875rem);
    --auth-header-margin-bottom: clamp(1.25rem, 2vw + 0.65rem, 1.75rem);
}

.auth-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin-bottom: var(--auth-header-margin-bottom);
}

.auth-brand-logo-wrap,
.brand-logo-container.auth-logo-container,
.text-center > .brand-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: var(--auth-logo-container-radius);
    padding: var(--auth-logo-container-padding);
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(15, 118, 110, 0.12);
    margin: 0 auto var(--auth-logo-gap) auto;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-brand-logo,
.brand-logo-auth,
.auth-logo {
    width: var(--auth-logo-size) !important;
    height: var(--auth-logo-size) !important;
    max-width: none !important;
    object-fit: contain;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0 auto;
}

.auth-brand-title {
    font-size: var(--auth-title-size) !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.5px !important;
    color: var(--primary, #0F766E) !important;
    margin: 0 0 var(--auth-title-gap) 0 !important;
    text-align: center;
}

.auth-brand-subtitle {
    font-size: var(--auth-subtitle-size) !important;
    color: var(--text-muted, #64748b) !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    text-align: center;
}

.brand-logo-header {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.brand-logo-footer {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: inline-block;
}

.brand-logo-card {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

/* Portal Footer */
.portal-footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem 2rem;
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.portal-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.portal-footer a:hover {
    color: var(--primary);
}

/* ============================================================
   RESPONSIVE ENHANCEMENTS (TABLET & MOBILE)
   ============================================================ */

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 8px;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
}

.sidebar-backdrop.show {
    display: block;
}

/* Tablet (768px – 991px): Navbar & Sidebar Sizing */
@media (min-width: 768px) and (max-width: 991.98px) {
    .brand-logo-header,
    .logo,
    .husna-logo {
        height: 32px !important;
        width: auto !important;
        max-width: none !important;
        object-fit: contain;
    }
    .brand-logo-sidebar {
        height: 36px !important;
        width: auto !important;
        max-width: 36px !important;
        object-fit: contain;
    }
    .brand-logo-footer {
        height: 36px !important;
        width: auto !important;
        max-width: 36px !important;
        object-fit: contain;
    }
}

/* Mobile (0px – 767px): Navbar & Sidebar Sizing */
@media (max-width: 767.98px) {
    .brand-logo-header,
    .logo,
    .husna-logo {
        height: 30px !important;
        width: auto !important;
        max-width: 30px !important;
        object-fit: contain;
    }
    .brand-logo-sidebar {
        height: 34px !important;
        width: auto !important;
        max-width: 34px !important;
        object-fit: contain;
    }
    .brand-logo-footer {
        height: 34px !important;
        width: auto !important;
        max-width: 34px !important;
        object-fit: contain;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
        background: var(--bg-main);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1.25rem;
    }

    .topbar {
        padding: 10px 1.25rem;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0.85rem;
    }

    .topbar {
        padding: 8px 1rem;
    }

    .topbar h5 {
        font-size: 0.95rem;
    }

    .glass-card:not(.dashboard-stat-card) {
        padding: 1.25rem !important;
    }
}

/* ============================================================
   DASHBOARD STATISTIC CARDS (RESPONSIVE KPI GRID)
   ============================================================ */

.dashboard-stats-row {
    min-width: 0;
}

.dashboard-stat-col {
    min-width: 0;
}

.dashboard-stat-card {
    min-width: 0;
    width: 100%;
}

.dashboard-stat-card .stat-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.dashboard-stat-card .stat-content {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: break-word;
    word-break: normal;
}

.dashboard-stat-card .stat-content h5 {
    overflow-wrap: break-word;
    word-break: normal;
}

/* Mobile (361px – 767px): 2 cards per row (2x2 grid) */
@media (max-width: 767.98px) {
    .dashboard-stats-row {
        display: flex;
        flex-wrap: wrap;
        margin-left: -0.375rem;
        margin-right: -0.375rem;
    }

    .dashboard-stat-col {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    .dashboard-stat-card {
        padding: 0.85rem 0.75rem !important;
        gap: 0.65rem !important;
    }

    .dashboard-stat-card .stat-icon-wrapper {
        width: 42px;
        height: 42px;
    }

    .dashboard-stat-card .stat-icon-wrapper i {
        font-size: 1.25rem !important;
    }

    .dashboard-stat-card .stat-content small {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .dashboard-stat-card .stat-content h5 {
        font-size: 0.95rem;
        line-height: 1.25;
        margin-top: 2px !important;
    }
}

/* Very Narrow Mobile (<= 360px): 1 card per row */
@media (max-width: 360px) {
    .dashboard-stat-col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .dashboard-stat-card {
        padding: 1rem 1.1rem !important;
        gap: 0.85rem !important;
    }

    .dashboard-stat-card .stat-icon-wrapper {
        width: 46px;
        height: 46px;
    }

    .dashboard-stat-card .stat-content h5 {
        font-size: 1.05rem;
    }
}

/* ============================================================
   ALUMNI DIRECTORY QUICK NAVIGATION & DISCOVERY BAR
   ============================================================ */

.directory-quick-nav-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: box-shadow var(--transition-fast);
}

[data-theme="dark"] .directory-quick-nav-card {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.directory-nav-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 118, 110, 0.2) transparent;
}

.directory-nav-scroll-wrapper::-webkit-scrollbar {
    height: 4px;
}

.directory-nav-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, 0.2);
    border-radius: 4px;
}

.directory-nav-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.directory-nav-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dir-nav-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 6px;
    opacity: 0.8;
}

[data-theme="dark"] .dir-nav-divider {
    background: rgba(255, 255, 255, 0.15);
}

.dir-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(226, 232, 240, 0.7);
    transition: all 180ms ease-in-out;
    white-space: nowrap;
    user-select: none;
    line-height: 1.3;
}

[data-theme="dark"] .dir-nav-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.dir-nav-item .dir-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--primary);
    transition: color 180ms ease-in-out;
}

.dir-nav-item-hof .dir-nav-icon {
    color: #d97706 !important; /* Premium Amber/Gold */
}

.dir-nav-item-saved .dir-nav-icon {
    color: #e11d48 !important; /* Rose / Heart */
}

.dir-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    transition: all 180ms ease-in-out;
    min-width: 18px;
}

/* Inactive Hover State */
.dir-nav-item:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.2);
    transform: translateY(-1px);
}

.dir-nav-item:hover .dir-nav-badge {
    background: var(--primary);
    color: #ffffff;
}

/* Active State */
.dir-nav-item.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
}

.dir-nav-item.active .dir-nav-icon {
    color: #ffffff !important;
}

.dir-nav-item.active .dir-nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Accessible focus visible */
.dir-nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive Styles for Tablet and Mobile */
@media (max-width: 991.98px) {
    .directory-quick-nav-card {
        padding: 8px 10px;
    }

    .dir-nav-item {
        padding: 7px 11px;
        font-size: 0.835rem;
    }
}

@media (max-width: 767.98px) {
    .directory-quick-nav-card {
        border-radius: 14px;
        padding: 8px 8px;
    }

    .directory-nav-scroll-wrapper {
        padding-bottom: 2px;
    }

    .directory-nav-list {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 2px 2px;
    }

    .directory-nav-group {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .dir-nav-item {
        padding: 8px 13px;
        min-height: 40px;
        background: #f8fafc;
        border: 1px solid rgba(226, 232, 240, 0.8);
        border-radius: 10px;
    }

    [data-theme="dark"] .dir-nav-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .dir-nav-item.active {
        background: var(--primary) !important;
        border-color: var(--primary) !important;
    }

    .dir-nav-divider {
        display: none !important;
    }
}
