/* ============================================================
   COLLEGE ADMISSION — ADMIN PANEL STYLES
   public/css/admin.css
   ============================================================ */

/* ---- CSS VARIABLES ---- */
:root {
    --primary:        #EE161F;
    --primary-hover:  #cc0f17;
    --primary-glow:   rgba(238, 22, 31, 0.15);
    --secondary:      #0C477F;
    --secondary-light:#1a65a8;
    --secondary-glow: rgba(12, 71, 127, 0.12);
    --bg:             #f0f3f8;
    --white:          #ffffff;
    --border:         #e4e8f0;
    --border-light:   #f0f2f8;
    --text-dark:      #1a2332;
    --text-muted:     #888;
    --sidebar-w:      250px;
    --header-h:       64px;
    --card-radius:    16px;
    --shadow:         0 2px 16px rgba(12, 71, 127, 0.07);
    --font-display:   'Playfair Display', serif;
    --font-body:      'DM Sans', sans-serif;
}

/* ---- RESET / BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--bg); margin: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--secondary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--white);
    margin: 0 0 2px;
    font-weight: 800;
}

.sidebar-brand p {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.sidebar-logo {
    width: 180px; height: 70px;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 6px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--primary);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

/* Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer .admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.admin-name  { font-size: 0.85rem; font-weight: 600; color: var(--white); }
.admin-email { font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(238, 22, 31, 0.15);
    border: 1.5px solid rgba(238, 22, 31, 0.3);
    color: #ff9195;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover { background: rgba(238, 22, 31, 0.25); color: var(--white); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--secondary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date  { font-size: 0.8rem; color: var(--text-muted); }

/* Page content */
.page-content { flex: 1; padding: 28px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-success {
    background: #e8f5e9;
    border: none;
    border-left: 4px solid #43a047;
    color: #2e7d32;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 500;
}

.flash-error {
    background: #fff0f0;
    border: none;
    border-left: 4px solid var(--primary);
    color: #c62828;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.stat-card {
    background: var(--white);
    border-radius: var(--card-radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(12, 71, 127, 0.14);
}

.stat-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-num   { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Section card */
.section-card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-card-header {
    padding: 16px 22px;
    border-bottom: 2px solid var(--border-light);
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card-body { padding: 20px 22px; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-block;
}

.status-new      { background: #e3f2fd; color: #1565c0; }
.status-reviewed { background: #e8f5e9; color: #2e7d32; }
.status-contacted{ background: #fff8e1; color: #f57f17; }
.status-admitted { background: #f3e5f5; color: #6a1b9a; }
.status-rejected { background: #fff0f0; color: #c62828; }

/* ============================================================
   TABLES
   ============================================================ */
.admin-table th {
    background: #f8fafd;
    color: #666;
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border: none;
}

.admin-table td {
    padding: 13px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td      { background: #fafbff; }

/* ============================================================
   BUTTONS (Admin)
   ============================================================ */
.btn-primary-admin {
    background: var(--secondary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary-admin:hover { background: var(--secondary-light); color: var(--white); }

.btn-danger-admin {
    background: #fff0f0;
    color: #c62828;
    border: 1.5px solid #ffcdd2;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger-admin:hover { background: #ffcdd2; }

.btn-save-admin {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-save-admin:hover { background: var(--primary-hover); }

.btn-view {
    background: var(--secondary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 6px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-view:hover { background: var(--secondary-light); color: var(--white); }

/* ============================================================
   FORM CONTROLS (Admin)
   ============================================================ */
.form-control,
.form-select {
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px var(--secondary-glow);
    outline: none;
}

/* ============================================================
   APPLICATION DETAIL
   ============================================================ */
.detail-card { background: var(--white); border-radius: var(--card-radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }

.detail-card-header {
    padding: 16px 24px;
    font-weight: 700;
    color: var(--secondary);
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.detail-card-body { padding: 24px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.info-label { font-size: 0.72rem; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.info-value { font-size: 0.92rem; font-weight: 600; color: var(--text-dark); }

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f6ff;
    color: var(--secondary);
    border: 1.5px solid #c0d9f0;
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
}

.branch-tag {
    display: inline-block;
    background: #f0f6ff;
    color: var(--secondary);
    border: 1.5px solid #c0d9f0;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 3px;
}

.feedback-text { font-size: 0.9rem; line-height: 1.6; color: var(--text-dark); }

.back-link {
    background: var(--border-light);
    color: #555;
    border: none;
    border-radius: 10px;
    padding: 9px 20px;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    transition: all 0.2s;
    cursor: pointer;
}

.back-link:hover { background: #e4e8f0; color: #333; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page-bg {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 50%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper { width: 100%; max-width: 420px; }

.login-brand { text-align: center; margin-bottom: 28px; }

.login-logo {
    width: 80px; height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.login-brand h1  { font-family: var(--font-display); color: var(--white); font-size: 1.5rem; margin: 0 0 4px; }
.login-brand p   { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; margin: 0; }

.login-card { background: var(--white); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); overflow: hidden; }

.login-card-header { background: var(--primary); padding: 16px 28px; color: var(--white); text-align: center; }
.login-card-header h5 { margin: 0; font-weight: 700; font-size: 1rem; }

.login-card-body { padding: 32px; }

.btn-login {
    width: 100%;
    background: var(--primary);
    border: none;
    color: var(--white);
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(238, 22, 31, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover { background: var(--primary-hover); transform: translateY(-1px); }

.back-to-form { text-align: center; margin-top: 20px; }
.back-to-form a { color: rgba(255, 255, 255, 0.75); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.back-to-form a:hover { color: var(--white); }

.input-icon-wrap  { position: relative; }
.input-icon-wrap .icon-left  { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 0.95rem; pointer-events: none; }
.input-icon-wrap .icon-right { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #aaa; }
.input-icon-wrap input { padding-left: 36px; }
.input-icon-wrap input.has-right { padding-right: 36px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .main-wrapper { margin-left: 0; }
    .page-content { padding: 16px; }
}

/* ============================================================
   MOBILE RESPONSIVE — HAMBURGER + SIDEBAR DRAWER
   ============================================================ */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-right: 10px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.2s;
}
.hamburger-btn:hover { background: #f0f3f8; }

/* Sidebar close button — hidden on desktop */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,0.22); }

/* Dark overlay behind sidebar on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ---- Breakpoint: tablet and below ---- */
@media (max-width: 991px) {

    /* Sidebar slides off screen by default */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
        transition: transform 0.3s ease;
        position: fixed;
    }

    /* Sidebar slides in when .open added */
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }

    /* Main wrapper takes full width */
    .main-wrapper {
        margin-left: 0 !important;
    }

    /* Show hamburger in topbar */
    .hamburger-btn { display: inline-flex; align-items: center; }

    /* Show close button inside sidebar */
    .sidebar-close-btn { display: inline-flex; }

    /* Topbar title smaller */
    .topbar-title { font-size: 0.95rem; }

    /* Page content less padding */
    .page-content { padding: 16px; }

    /* Topbar padding */
    .topbar { padding: 0 16px; }

    /* Stat cards — 2 per row on tablet */
    .stat-card { padding: 16px; gap: 12px; }
    .stat-num  { font-size: 1.6rem; }
}

/* ---- Breakpoint: phone ---- */
@media (max-width: 575px) {

    .page-content { padding: 12px; }

    /* Stat cards full width stacked */
    .stat-icon { width: 44px; height: 44px; font-size: 1.2rem; }
    .stat-num  { font-size: 1.4rem; }
    .stat-label { font-size: 0.72rem; }

    /* Tables scroll horizontally */
    .table-responsive { font-size: 0.82rem; }

    /* Detail info grid single column */
    .info-grid { grid-template-columns: 1fr !important; }

    /* Hide date in topbar on small screens */
    .topbar-date { display: none; }

    /* Section card header smaller */
    .section-card-header { font-size: 0.85rem; padding: 12px 16px; }
    .section-card-body   { padding: 14px 16px; }

    /* Detail cards */
    .detail-card-header { padding: 12px 16px; font-size: 0.85rem; }
    .detail-card-body   { padding: 16px; }

    /* Buttons full width on mobile for forms */
    .btn-primary-admin,
    .btn-save-admin { width: 100%; justify-content: center; }

    /* Review grid single column */
    .review-grid { grid-template-columns: 1fr; }

    /* Login page */
    .login-card-body { padding: 20px 16px; }
    .login-brand h1  { font-size: 1.2rem; }

    /* Sidebar brand smaller */
    .sidebar-brand h2 { font-size: 0.95rem; }
    .sidebar-brand    { padding: 14px 14px 12px; }
    .sidebar-brand p  { font-size: 0.68rem; }
    .sidebar-nav .nav-link { padding: 10px 16px; font-size: 0.85rem; }
}
