/* ==========================================================================
   SGU Admission Portal Design System (Midnight Navy & Warm Gold Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700;800&display=swap');

/* Color Variables */
:root {
    --bg-primary: #0a0f1d;
    --bg-secondary: #0f162a;
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --gold: #d4af37;
    --gold-hover: #bfa030;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-red: #ef4444;
    --accent-red-bg: rgba(239, 68, 68, 0.15);
    --accent-green: #10b981;
    --accent-green-bg: rgba(16, 185, 129, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(212, 175, 55, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 22, 42, 0.8) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Layout Containers */
.app-container {
    width: 95%;
    max-width: 1400px;
    margin: 40px auto;
    padding-bottom: 60px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-meta {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-meta span.name {
    color: var(--gold);
    font-weight: 600;
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    margin-bottom: 25px;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
    color: var(--gold);
}

/* Dashboard Forms Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

label span.required {
    color: var(--accent-red);
}

/* Inputs & Form Controls */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 22, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    background: rgba(15, 22, 42, 0.9);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
}

/* Buttons */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
    width: auto;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, #b8901c 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
    background: linear-gradient(135deg, #ffd700 0%, var(--gold) 100%);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: var(--accent-red-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Live Analytics / Metric Stats widget */
.metrics-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.metric-card {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--gold);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Glass Navigation Bar Styles */
.navbar-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.navbar {
    background: rgba(10, 15, 29, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--card-border);
    height: 70px;
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand span {
    color: var(--gold);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 16px;
    border-radius: 6px;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown styling */
.nav-dropdown {
    position: absolute;
    top: 90%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    min-width: 220px;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    z-index: 150;
    animation: dropSlide 0.25s ease forwards;
}

@keyframes dropSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown li {
    list-style: none;
}

.nav-dropdown a {
    color: var(--text-secondary);
    padding: 10px 20px;
    display: block;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-dropdown a:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.04);
    padding-left: 24px;
}

.nav-item:hover .nav-dropdown {
    display: flex;
}

/* User Role Badge in Nav */
.user-badge {
    background: var(--gold-glow);
    color: var(--gold);
    border: 1px solid var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Hamburger mobile menu button */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Modern Tables styling */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    margin-top: 15px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

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

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
}

th {
    background-color: rgba(15, 22, 42, 0.8);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--card-border);
}

tr {
    transition: var(--transition);
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
    border-bottom: none;
}

/* Total row highlights */
.total-row {
    font-weight: 700;
    background: rgba(212, 175, 55, 0.08) !important;
    border-top: 2px solid rgba(212, 175, 55, 0.25);
    color: var(--gold);
}

/* Notifications, Errors & Success alerts */
.error,
.success,
.alert-box {
    margin: 20px 0;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error {
    background: var(--accent-red-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success {
    background: var(--accent-green-bg);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.error ul,
.success ul {
    list-style: inside disc;
}

/* Flatpickr override custom calendar design */
.flatpickr-calendar {
    background: #0f162a !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    font-family: inherit !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    color: #000 !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #0f162a !important;
    color: #fff !important;
}

/* Login screen specific layout */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 5px;
}

/* Multi-row entry template helper class */
.entry-row-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.entry-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.entry-row-num {
    font-weight: bold;
    color: var(--gold);
    font-size: 0.95rem;
}

/* Print Stylesheet Overrides */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
    }
    
    .navbar-wrapper,
    .navbar,
    .report-form,
    .btn,
    button,
    .print-btn,
    .hamburger,
    form {
        display: none !important;
    }
    
    .app-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .glass-card {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .page-title {
        color: #000000 !important;
        -webkit-text-fill-color: initial !important;
        background: none !important;
        font-size: 16pt !important;
        margin-bottom: 10px !important;
    }
    
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    th, td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        padding: 6px 8px !important;
        font-size: 10pt !important;
    }
    
    th {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .total-row {
        background-color: #eaeaea !important;
        color: #000000 !important;
    }
}

/* Responsive Mobile Layouts */
@media (max-width: 768px) {
    .navbar {
        height: 60px;
        padding: 0 15px;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--card-border);
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        display: none;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-item {
        width: 100%;
        height: auto;
    }
    
    .nav-link {
        width: 100%;
        padding: 12px 24px;
        border-radius: 0;
    }
    
    .nav-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0,0,0,0.15);
        padding-left: 20px;
        display: none;
    }
    
    .nav-item:hover .nav-dropdown {
        display: none; /* disable hover dropdown on touch/mobile screens */
    }
    
    .nav-item.active .nav-dropdown {
        display: flex; /* toggled via simple JS on click instead */
    }
    
    .app-container {
        width: 92%;
        margin: 20px auto;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .glass-card {
        padding: 20px 15px;
    }
    
    .metrics-row {
        gap: 10px;
    }
    
    .metric-card {
        min-width: 45%;
        padding: 15px 10px;
    }
}
