/* =====================================================
   Hệ thống Quản lý Ứng tuyển Thực tập - Main CSS
   ===================================================== */

/* ---- CSS Variables ---- */
:root {
    --primary-color: #0056b3;
    --secondary-color: #007bff;
    --text-color: #333;
    --bg-color: #f4f6f9;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;

    /* Sidebar variables */
    --sidebar-width: 240px;
    --sidebar-bg: #1a2a4a;
    --sidebar-text: #c8d6e8;
    --sidebar-hover-bg: #243557;
    --sidebar-active-bg: #007bff;
    --sidebar-active-text: #ffffff;
    --sidebar-header-bg: #0f1e35;
    --topbar-height: 56px;
    --topbar-bg: #ffffff;
    --topbar-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ---- Reset ---- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =====================================================
   ADMIN LAYOUT
   ===================================================== */

.admin-body {
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* Wrapper tổng: sidebar + main */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    background: var(--sidebar-header-bg);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-header .sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sidebar-header .sidebar-logo span {
    color: var(--secondary-color);
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5a7090;
    padding: 0.8rem 1.2rem 0.3rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.2rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.925rem;
    border-left: 3px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #ffffff;
    border-left-color: rgba(0, 123, 255, 0.5);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: #66b2ff;
    font-weight: 600;
}

.sidebar-link .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.8rem;
    color: #5a7090;
    text-align: center;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ---- Admin Main Area ---- */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ---- Admin Topbar ---- */
.admin-topbar {
    background: var(--topbar-bg);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: var(--topbar-shadow);
    position: sticky;
    top: 0;
    z-index: 900;
    gap: 0.75rem;
}

.topbar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #555;
    margin-left: auto;
}

.topbar-user strong {
    color: var(--primary-color);
}

.topbar-user a {
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--danger);
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.topbar-user a:hover {
    background: var(--danger);
    color: white;
}

/* ---- Hamburger Button ---- */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}

.hamburger:hover {
    background: #f0f0f0;
}

/* ---- Admin Content ---- */
.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* ---- Admin Footer ---- */
.admin-footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #e8ecf0;
    text-align: center;
    font-size: 0.82rem;
    color: #888;
}

/* =====================================================
   RESPONSIVE - Mobile
   ===================================================== */

@media (max-width: 767px) {
    /* Sidebar ẩn mặc định trên mobile */
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    /* Khi sidebar mở (class toggle bằng JS) */
    .admin-sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    }

    /* Main content chiếm full width */
    .admin-main {
        margin-left: 0;
    }

    /* Hiện hamburger trên mobile */
    .hamburger {
        display: block;
    }

    /* Content padding nhỏ hơn trên mobile */
    .admin-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0 1rem;
    }

    .topbar-title {
        display: none;
    }

    .topbar-user span {
        font-size: 0.85rem;
    }

    /* Row cols xuống full width */
    .col-4,
    .col-6,
    .col-8 {
        width: 100%;
    }

    /* Public Navbar Layout trên Mobile */
    .mobile-menu-toggle {
        display: block !important;
    }

    .nav-links {
        display: none; /* Ẩn mặc định, hiện khi có class active */
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a,
    .nav-links .btn {
        margin-left: 0;
        margin-top: 0;
        padding: 0.6rem 1rem;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }

    .user-greeting {
        width: 100%;
        text-align: center;
        margin-bottom: 0.4rem;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    /* Sidebar luôn hiện trên PC */
    .admin-sidebar {
        transform: translateX(0) !important;
    }

    .hamburger {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* =====================================================
   PUBLIC LAYOUT (non-admin pages)
   ===================================================== */

/* Layout */
.container {
    width: 90%;
    margin: 0 auto;
    max-width: 1200px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col-12 {
    width: 100%;
    padding: 10px;
}

.col-8 {
    width: 66.66%;
    padding: 10px;
}

.col-6 {
    width: 50%;
    padding: 10px;
}

.col-4 {
    width: 33.33%;
    padding: 10px;
}

.m-auto {
    margin: 0 auto;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

/* Navbar (public pages) */
.navbar {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar .logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.user-greeting {
    margin-left: 1rem;
    font-weight: bold;
}

/* Main content padding (public pages) */
.main-content {
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-outline-white {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
}

.btn-outline-white:hover {
    background: var(--white);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b02a37;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* =====================================================
   CARD
   ===================================================== */

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card h2,
.card h3 {
    margin-bottom: 0.75rem;
}

/* Stat card (dashboard) */
.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    border-top: 4px solid var(--secondary-color);
}

.stat-card.warning {
    border-top-color: var(--warning);
}

.stat-card.info {
    border-top-color: var(--info);
}

.stat-card.success {
    border-top-color: var(--success);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* =====================================================
   AUTH PAGES
   ===================================================== */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 400px;
    max-width: 100%;
}

/* =====================================================
   FORMS
   ===================================================== */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 4px solid transparent;
    font-size: 0.92rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

/* =====================================================
   TABLE
   ===================================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* =====================================================
   STATUS BADGES
   ===================================================== */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.pending {
    background: var(--warning);
    color: #333;
}

.approved {
    background: var(--secondary-color);
}

.interview {
    background: var(--info);
}

.passed {
    background: var(--success);
}

.rejected {
    background: var(--danger);
}

/* =====================================================
   JOB GRID (public pages)
   ===================================================== */

.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.job-card hr {
    margin: 10px 0;
    border: 0;
    border-top: 1px solid #eee;
}

.job-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.4rem;
}

/* =====================================================
   AVATAR
   ===================================================== */

.avatar-preview {
    border-radius: 50%;
    border: 2px solid #ccc;
    object-fit: cover;
}

/* =====================================================
   UTILITIES
   ===================================================== */

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-success {
    color: var(--success);
}

.text-info {
    color: var(--info);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: #856404;
}

.text-muted {
    color: #6c757d;
}

.text-sm {
    font-size: 0.85rem;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.w-100 {
    width: 100%;
}

/* =====================================================
   FOOTER (public pages)
   ===================================================== */

footer {
    margin-top: 40px;
    padding: 20px 0;
    background: #333;
    color: white;
    text-align: center;
}

/* Page header / breadcrumb strip */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header h2 {
    font-size: 1.3rem;
    color: #2d3748;
    margin: 0;
}

/* Divider */
hr.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1rem 0;
}