html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
:root {
    --bg-light: #eef2ff;
    --bg-mid: #dbe4ff;

    --text-primary: #0f172a;
    --text-secondary: #475569;

    --accent-dark: #1e293b;
    --accent-brown: #334155;

    --border-glass: rgba(255, 255, 255, 0.35);

    --primary-color: #2563eb;
    --accent-color: #60a5fa;
    --dark-color: #0f172a;

    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;

    --gradient-primary: linear-gradient(135deg, #1E40AF, #2563EB);
    --gradient-secondary: linear-gradient(135deg, #7C3AED, #2563EB);
    --gradient-success: linear-gradient(135deg, #16A34A, #22C55E);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(
        135deg,
        #B9C3FF 0%,
        #6879E2 80%
    );
}




/* Navigation */

/* =========================
   Top Bar / Navbar – Glass Blue
   ========================= */
.navbar {
    background: linear-gradient(
        135deg,
        #6879E2,
        #B9C3FF        
    );

    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);

    border-bottom: 1px solid var(--border-glass);

    box-shadow:
        0 10px 30px rgba(51, 28, 8, 0.25);
}
.navbar-brand {
    color: var(--accent-dark) !important;
    font-weight: 600;
}

.navbar-brand i {
    color: var(--accent-brown);
}

.nav-link {
    color: var(--accent-dark);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    transform: translateY(-1px);
}

/* =========================
   Navbar Search – Expand & Glass
   ========================= */

/* Search form container */
#navbar-search-form {
    min-width: 320px !important;   /* 🔥 override inline 180px */
    opacity: 0;
    transform: translateY(-50%) scale(0.96);

	    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* When visible (Bootstrap removes d-none) */
#navbar-search-form:not(.d-none) {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Input styling */
#navbar-search-form .form-control {
    border-radius: 999px 0 0 999px;
    padding: 8px 16px;

    background: rgba(255,255,255,0.65);
    color: #0F172A;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.45);

    transition:
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

/* Focus = glassy glow */
#navbar-search-form .form-control:focus {
    outline: none;

    border-color: rgba(30, 94, 214, 0.6);

    box-shadow:
        0 8px 25px rgba(30, 94, 214, 0.35);
}

/* Search button */
#navbar-search-form .btn {
    border-radius: 0 999px 999px 0;
}



/* =========================
   Cards – Glassy, Cool (Option 1)
   ========================= */

.card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;

    /* White glass surface */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85),
        rgba(233, 238, 255, 0.75)
    );

    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);

    border: 1px solid rgba(255, 255, 255, 0.5);

    /* Bubbly floating shadow */
    box-shadow:
        0 20px 45px rgba(104, 121, 226, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);

    transition:
        transform 0.35s cubic-bezier(.22,1,.36,1),
        box-shadow 0.35s cubic-bezier(.22,1,.36,1),
        background 0.35s ease;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);

    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.92),
        rgba(244, 246, 255, 0.85)
    );

    box-shadow:
        0 30px 70px rgba(104, 121, 226, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.card-header {
    background: linear-gradient(
        135deg,
        rgba(244, 246, 255, 0.85),
        rgba(233, 238, 255, 0.75)
    );

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    color: #1E293B;
    font-weight: 600;

    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 26px 26px 0 0;
}


.card h5 {
    color: var(--text-primary);
    font-weight: 600;
}

.card p {
    color: var(--text-secondary);
}


/* Buttons */
.btn {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
}
.btn-primary {
    background: linear-gradient(
        135deg,
        #1E40AF,
        #2563EB
    );
    color: #FFFFFF;
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        #1E3A8A,
        #1D4ED8
    );
    box-shadow: 0 14px 40px rgba(37, 99, 235, 0.35);
}



.btn-success {
    background: #2b2bfb;
    color: red;
}

.btn-success:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(79, 175, 80, 0.4);
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.btn-warning {
    background: var(--gradient-secondary);
    color: white;
}

.btn-warning:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 152, 0, 0.4);
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Test Cards */
.test-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.test-card .card-body {
    padding: 30px;
}

.test-card h5 {
    color: var(--dark-color);
    font-weight: bold;
    margin-bottom: 15px;
}

.test-card .badge {
    font-size: 0.8rem;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.test-card .badge:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}


.stat-card-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.stat-card-inline .stat-label {
    margin-bottom: 0;
}

.stat-card-inline .stat-value {
    font-size: 1.25rem;
    line-height: 1;
    white-space: nowrap;
}


/* Question Styles */
.question-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
    
}

.question-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.question-number {
    background: var(--gradient-primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Fill in the Blank */
.fill-blank {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 8px 15px;
    margin: 0 8px;
    min-width: 120px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.fill-blank:focus {
    border-color: var(--primary-color);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.fill-blank.correct {
    border-color: var(--success-color);
    background: #d4edda;
}

.fill-blank.incorrect {
    border-color: var(--danger-color);
    background: #f8d7da;
}

/* Highlight Feature */
.highlight {
    background-color: transparent;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.highlight:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.highlight.active {
    background-color: var(--accent-color);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.5);
}

/* Audio Player (Listening Section) */
/* Đã loại bỏ toàn bộ CSS .audio-player và .audio-player audio để kiểm tra hiển thị audio mặc định */

/* Progress Bar */
.progress-container {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 3px;
    margin: 20px 0;
}

.progress-bar {
    height: 12px;
    border-radius: 8px;
    background: var(--gradient-success);
    transition: width 0.3s ease;
}

/* Timer */
.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--danger-color);
    text-align: center;
    padding: 15px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.timer.warning {
    color: var(--warning-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Writing Section */
.writing-editor {
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    min-height: 300px;
    font-size: 12px;
    line-height: 1.8;
    transition: border-color 0.3s ease;
}

.writing-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Results Page */
.results-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.score-card {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
    color: white;
    transition: all 0.3s ease;
}

.score-card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.score-card.reading {
    background: var(--gradient-primary);
}

.score-card.listening {
    background: var(--gradient-secondary);
}

.score-card.writing {
    background: var(--gradient-success);
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }
    
    .question-container {
        padding: 20px;
    }
    
    .fill-blank {
        min-width: 80px;
        margin: 5px;
    }
    
    .timer {
        font-size: 1.2rem;
    }
    
    .score-number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    border-radius: 15px;
    border: none;
    padding: 15px 20px;
    margin: 20px 0;
}

.alert-success {
    background: var(--gradient-success);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.alert-warning {
    background: var(--gradient-secondary);
    color: white;
} 

/* Đồng bộ nút logout với nav-link */
.logout-link {
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline;
}
.logout-link:hover, .logout-link:focus {
    color: var(--accent-color);
    text-decoration: underline;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 5px;
    padding: 5px 10px;
} 

.writing-section {
  display: flex;
  height: 100%;
}

.question-panel {
  flex: 0 0 40%;
  min-width: 200px;
  background: #fff;
  padding: 1rem;
  border-radius: 8px 0 0 8px;
  overflow: auto;
}

.divider {
  width: 5px;
  cursor: col-resize;
  background: #ccc;
}

.answer-panel {
  flex: 1;
  background: #fff;
  padding: 10px;
  display:flex;
  flex-direction: column;
}

.answer-panel textarea{
  flex:1;
}

mark.highlighted {
    background-color: yellow !important;
    color: black !important;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== Motion discipline ===== */

.card:hover,
.test-card:hover,
.score-card:hover {
    transform: translateY(-3px);
}

/* ===== Navbar refinement ===== */

.nav-link {
    position: relative;
    background: none !important;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.25s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link:hover {
    transform: none;
}

/* ===== Button polish ===== */

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}
/* ===== Typography hierarchy ===== */

h1, h2, h3, h4, h5 {
    letter-spacing: 0.3px;
}

p {
    margin-bottom: 0.75rem;
}
/* ===== Question container refinement ===== */

.question-container {
    border-left-width: 4px;
}

.question-container:hover {
    transform: none;
}


/* Attendance table */
.attendance-table {
    table-layout: fixed;
    border-collapse: collapse;
}

/* Attendance cells */
.attendance-cell {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    padding: 0px !important;
    text-align: center;
    align-items: center;
    justify-content: center;
}

/* Button: size NEVER changes */
.attendance-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0 !important;
    border-radius: 4px;
    border: 1px solid #cfd4da;
    background-color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    cursor: pointer;
    outline: none;

    transition: background-color 0.1s ease, border-color 0.1s ease;
}

/* Present */
.attendance-btn.present {
    background-color: #4f46e5; /* calm professional blue */
    border-color: #4f46e5;
}

/* Optional checkmark via CSS (no layout impact) */
.attendance-btn.present.attendance-check{
    opacity: 1;
}

/* Hover */
.attendance-btn:hover {
    border-color: #4f46e5;
}

/* Scroll container for attendance table */
.attendance-scroll {
    max-height: 75vh;        /* adjust if needed */
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}
