/*
 * PTC UniCore SIS 2026 - Master Design System & Commercial UI/UX
 * Presbyterian Theological College, Dumaguete City, Philippines
 */

:root {
    --primary-navy: #071e3d;
    --primary-navy-dark: #041226;
    --primary-blue: #0b2e59;
    --secondary-blue: #15437a;
    --accent-gold: #d4af37;
    --accent-gold-light: #fef08a;
    --accent-gold-dark: #aa861a;
    --accent-gold-glow: rgba(212, 175, 55, 0.35);
    
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #071e3d;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border-color: #e2e8f0;
    --border-gold: rgba(212, 175, 55, 0.4);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px -2px rgba(7, 30, 61, 0.08);
    --shadow-lg: 0 12px 28px -4px rgba(7, 30, 61, 0.12);
    --shadow-gold: 0 8px 24px rgba(212, 175, 55, 0.25);
    
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-display: 'Cinzel', serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Top Navigation Bar */
.sis-topbar {
    background: rgba(7, 30, 61, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--accent-gold);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.sis-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    cursor: pointer;
}

.sis-brand img {
    height: 46px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    transition: transform 0.2s ease;
}
.sis-brand:hover img {
    transform: scale(1.05);
}

.sis-brand-text .title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #ffffff;
}

.sis-brand-text .subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.sis-top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-term {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.84rem;
}

/* Language Switcher Pills */
.lang-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.lang-btn {
    background: transparent;
    color: #cbd5e1;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}
.lang-btn.active {
    background: var(--accent-gold);
    color: #071e3d;
    box-shadow: 0 1px 4px rgba(212, 175, 55, 0.3);
}
.skiptranslate, #google_translate_element { display: none !important; }

/* Master Layout Structure */
.sis-wrapper {
    display: flex;
    min-height: calc(100vh - 66px);
}

/* Sidebar Navigation */
.sis-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    transition: width 0.3s ease;
}

.sidebar-nav {
    list-style: none;
    padding: 20px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-item:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.07);
    transform: translateX(3px);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, rgba(11, 46, 89, 0.7) 100%);
    border-left: 4px solid var(--accent-gold);
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

/* Main Workspace */
.sis-content {
    flex-grow: 1;
    padding: 28px 36px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* KPI Metric Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-navy);
    margin-top: 6px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(7, 30, 61, 0.06);
    color: var(--primary-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Panel Containers */
.sis-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-navy);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Enterprise Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.sis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.sis-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 700;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.4px;
}

.sis-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.sis-table tr:hover td {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-enrolled { background: #dcfce7; color: #15803d; }
.badge-leave { background: #fef9c3; color: #854d0e; }
.badge-graduated { background: #e0e7ff; color: #4338ca; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #ffedd5; color: #9a3412; }
.badge-confirmed { background: #e0f2fe; color: #0369a1; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background: var(--primary-navy);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #aa861a 100%);
    color: #071e3d;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}
.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}
.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(7, 30, 61, 0.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 30, 61, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
}
.modal-card {
    background: #ffffff;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-navy);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--primary-navy);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-gold);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Mobile Menu Utilities */
.btn-mobile-menu, .btn-close-menu {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}
.mobile-sidebar-header {
    display: none;
    padding: 16px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    align-items: center;
    justify-content: space-between;
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Breakpoints (Mobile & Tablet <= 1024px) */
@media (max-width: 1024px) {
    /* 1. Ultra-Compact Topbar: Strictly 48px height, 0 scroll */
    .sis-topbar {
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        flex-wrap: nowrap !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important;
    }

    /* 2. Prominent Gold Hamburger Button - ALWAYS Visible on Mobile */
    .btn-mobile-menu {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        width: 38px !important;
        height: 38px !important;
        background: rgba(212, 175, 55, 0.22) !important;
        border: 1.5px solid #d4af37 !important;
        border-radius: 8px !important;
        color: #d4af37 !important;
        font-size: 1.3rem !important;
        margin-right: 6px !important;
        cursor: pointer !important;
        padding: 0 !important;
        z-index: 1001 !important;
    }

    /* 3. 교수님 지침 반영: 상단 프레임 로고 및 대학명/부제목 완전 숨김 (하단 프레임 중복 해소) */
    .sis-brand {
        display: none !important;
    }

    /* 4. Top Actions: Hide bulky items, keep only Lang + Compact Logout */
    .sis-top-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    .badge-term {
        display: none !important;
    }
    .sis-top-actions .btn-gold {
        display: none !important;
    }
    .lang-pills span {
        display: none !important;
    }
    .lang-pills {
        padding: 2px !important;
        gap: 2px !important;
    }
    .lang-btn {
        padding: 3px 6px !important;
        font-size: 0.72rem !important;
    }

    /* 5. Mobile User Status on Header */
    #userProfileGroup {
        gap: 6px !important;
    }
    .user-pill {
        display: none !important;
    }
    #userProfileGroup .btn-outline {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 4px 8px !important;
        height: 30px !important;
        font-size: 0.74rem !important;
        background: rgba(239, 68, 68, 0.15) !important;
        border: 1px solid rgba(239, 68, 68, 0.5) !important;
        color: #fca5a5 !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }

    /* 6. Off-Canvas Sliding Navigation Drawer */
    .sis-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 270px !important;
        max-width: 82vw !important;
        z-index: 2000 !important;
        flex-direction: column !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background: #071e3d !important;
        border-right: 1px solid rgba(212, 175, 55, 0.3) !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5) !important;
        display: flex !important;
    }
    .sis-sidebar.mobile-open {
        transform: translateX(0) !important;
    }
    .mobile-sidebar-header {
        display: flex !important;
        padding: 12px 16px !important;
        background: rgba(0,0,0,0.3) !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .sidebar-nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        padding: 14px 10px !important;
        overflow-y: auto !important;
        flex: 1 1 auto !important;
    }
    .sidebar-nav .nav-item {
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
        border-radius: 8px !important;
        margin-bottom: 4px !important;
    }
    .sidebar-footer {
        padding: 12px !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
    }
    .btn-mobile-logout {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        background: #ef4444 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 8px !important;
        cursor: pointer !important;
    }
    .sidebar-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.6) !important;
        backdrop-filter: blur(2px) !important;
        z-index: 1999 !important;
        display: none;
    }
    .sidebar-overlay.active {
        display: block !important;
    }
}
