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

:root {
    --vtei-blue: #1a4b8a;
    --vtei-blue-dark: #0d2f5e;
    --vtei-green: #1e7d37;
    --vtei-green-light: #27ae60;
    --vtei-gold: #d4a017;
    --vtei-gold-light: #f1c40f;

    --grad-blue: linear-gradient(135deg, #1a4b8a 0%, #0d2f5e 100%);
    --grad-green: linear-gradient(135deg, #1e7d37 0%, #145726 100%);
    --grad-gold: linear-gradient(135deg, #d4a017 0%, #a37a10 100%);
    --grad-hero: linear-gradient(135deg, #0d2f5e 0%, #1a4b8a 40%, #1e7d37 100%);
    --grad-card-hover: linear-gradient(135deg, #1a4b8a 0%, #1e7d37 100%);

    --bg: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1a202c;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.5);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(13, 47, 94, 0.15);
    --shadow-glow-blue: 0 8px 32px rgba(26, 75, 138, 0.35);
    --shadow-glow-green: 0 8px 32px rgba(30, 125, 55, 0.35);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(26, 75, 138, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(30, 125, 55, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ───────── HEADER ───────── */
header {
    background: var(--grad-blue);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.header-logo .logo-badge {
    background: linear-gradient(135deg, var(--vtei-gold-light), var(--vtei-gold));
    color: var(--vtei-blue-dark);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.header-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.25s;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

/* ───────── MAIN CONTAINER ───────── */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ───────── HERO SECTION (головна сторінка) ───────── */
.hero {
    background: var(--grad-hero);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-label {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: var(--vtei-gold-light);
    border: 1px solid rgba(241, 196, 15, 0.3);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    text-align: center;
}

.hero p {
    font-size: 17px;
    color: rgba(255,255,255,0.75);
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

/* ───────── SECTION TITLE ───────── */
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--vtei-blue-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, rgba(26,75,138,0.15), transparent);
    border-radius: 2px;
}

/* ───────── TEST CARDS GRID ───────── */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.test-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-blue);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.test-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-glow-blue);
    border-color: rgba(26,75,138,0.2);
}

.test-card:hover .test-card-btn {
    background: var(--grad-card-hover);
    box-shadow: var(--shadow-glow-blue);
    color: #fff;
    transform: translateX(4px);
}

.test-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.test-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-card-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--vtei-green);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: rgba(30, 125, 55, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
}

.test-card-questions {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.test-card-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--vtei-blue-dark);
    line-height: 1.35;
}

.test-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

.test-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--grad-blue);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 75, 138, 0.25);
    margin-top: 4px;
}

.test-card-btn .arrow {
    transition: transform 0.3s;
}

.test-card:hover .test-card-btn .arrow {
    transform: translateX(4px);
}

/* ───────── GLASS PANEL (для тест-сторінки) ───────── */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    border: 1px solid var(--border);
}

/* ───────── TEST PAGE HEADER ───────── */
.test-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 2px solid rgba(26,75,138,0.08);
}

.test-page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--vtei-blue-dark);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.test-page-header h2 {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ───────── STUDENT INFO ───────── */
.student-info {
    display: flex;
    gap: 20px;
    margin-bottom: 36px;
    background: linear-gradient(135deg, rgba(26,75,138,0.04), rgba(30,125,55,0.04));
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(26,75,138,0.08);
}

.student-info div { flex: 1; }

.student-info label {
    display: block;
    font-weight: 600;
    color: var(--vtei-blue);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.student-info input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(26,75,138,0.15);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    background: rgba(255,255,255,0.9);
    color: var(--text-main);
    transition: all 0.25s;
    outline: none;
}

.student-info input:focus {
    border-color: var(--vtei-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 75, 138, 0.12);
}

.student-info input::placeholder { color: #adb5bd; font-weight: 400; }

/* ───────── QUESTIONS ───────── */
.question {
    background: #fff;
    border-left: 4px solid var(--vtei-blue);
    padding: 24px 28px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(26,75,138,0.06);
    border-left: 4px solid var(--vtei-blue);
    transition: all 0.25s;
}

.question:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.question p {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.5;
}

.options label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14.5px;
    transition: background 0.2s;
    line-height: 1.5;
}

.options label:hover { background: rgba(26,75,138,0.05); }

.options input[type="radio"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--vtei-blue);
    cursor: pointer;
}

/* ───────── SUBMIT BUTTON ───────── */
.btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: var(--grad-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    margin-top: 32px;
    box-shadow: var(--shadow-glow-green);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(30, 125, 55, 0.45);
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ───────── RESULT ───────── */
#result {
    display: none;
    text-align: center;
    margin-top: 24px;
    padding: 20px;
    background: rgba(26, 75, 138, 0.03);
    border: 1px solid rgba(26, 75, 138, 0.1);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.6;
}

#result b {
    display: block;
    font-size: 18px;
    text-transform: uppercase;
    color: var(--vtei-blue-dark);
    margin-bottom: 4px;
}

/* ───────── STATUS ───────── */
#sendStatus {
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    font-weight: 500;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    min-height: 24px;
    transition: all 0.3s;
}

.status-sending {
    background: rgba(212, 160, 23, 0.1);
    color: #b07d0e;
    border: 1px solid rgba(212, 160, 23, 0.25);
}

.status-ok {
    background: linear-gradient(135deg, rgba(30, 125, 55, 0.08), rgba(30, 125, 55, 0.04));
    color: var(--vtei-green);
    border: 1px solid rgba(30, 125, 55, 0.2);
}

.status-error {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 768px) {
    .glass-panel { padding: 28px 20px; }
    .hero { padding: 40px 24px; }
    .hero h1 { font-size: 26px; }
    .student-info { flex-direction: column; }
    .tests-grid { grid-template-columns: 1fr; }
    .header-content { padding: 0 16px; }

    /* Таблиця на мобільних */
    .practicals-table th, 
    .practicals-table td { 
        padding: 12px 10px; 
        font-size: 13.5px; 
    }
    .practicals-table thead th {
        white-space: normal !important; /* Дозволяємо перенесення рядків (перевизначаємо глобальний nowrap) */
        font-size: 11px !important;     /* Зменшуємо шрифт заголовків */
        letter-spacing: 0 !important;   /* Прибираємо міжлітерний інтервал */
    }
    .practicals-table td:first-child { width: 40px; }
    .download-link { width: 32px; height: 32px; font-size: 16px; }
}

/* ───────── BURGER MENU ───────── */
.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 201;
    position: relative;
}

.burger-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 47, 94, 0.6);
    backdrop-filter: blur(4px);
    z-index: 149;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar */
.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(180deg, #0d2f5e 0%, #1a4b8a 100%);
    z-index: 150;
    padding: 90px 28px 40px;
    transition: right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.3);
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-left: 16px;
}

.side-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.25s;
    margin-bottom: 4px;
}

.side-menu a:hover,
.side-menu a.active-link {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.side-menu a .menu-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.side-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 16px 0;
}

/* ───────── PRACTICALS PAGE ───────── */
.practicals-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.practicals-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 14.5px;
}

.practicals-table thead {
    background: var(--grad-blue);
    color: #fff;
}

.practicals-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.practicals-table thead th:nth-child(2) {
    width: auto;
}

.practicals-table tbody tr {
    border-bottom: 1px solid rgba(26,75,138,0.06);
    transition: all 0.2s;
    position: relative;
}

.practicals-table tbody tr:last-child {
    border-bottom: none;
}

.practicals-table tbody tr:has(.download-link:not(.disabled)):hover {
    background: rgba(26,75,138,0.03);
    cursor: pointer;
}

.practicals-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

.practicals-table td:first-child {
    font-weight: 700;
    color: var(--vtei-blue);
    text-align: center;
    width: 60px;
}

.td-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-right: 20px; /* Ensure space for the button */
}

.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(30, 125, 55, 0.1);
    color: var(--vtei-green);
    border-radius: 10px;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.25s;
}

.download-link:hover {
    background: var(--vtei-green);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-green);
}

.download-link.disabled {
    opacity: 0.3;
    pointer-events: none;
    background: rgba(100,116,139,0.1);
    color: var(--text-muted);
}

.practicals-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.practicals-status.available {
    background: rgba(30, 125, 55, 0.1);
    color: var(--vtei-green);
}

.practicals-status.soon {
    background: rgba(100,116,139,0.1);
    color: var(--text-muted);
}

