:root {
    --primary: #4361ee;
    --secondary: #3a56d4;
    --success: #4cc9f0;
    --danger: #f72585;
    --dark: #212529;
    --light: #f8f9fa;
    --grey: #6c757d;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dark);
}

/* --- Header & Navigation --- */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo i {
    margin-right: 8px;
}

nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

nav a:hover {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

nav a.button {
    background: var(--primary);
    color: white;
}

nav a.button:hover {
    background: var(--secondary);
    color: white;
}

/* --- Main Container --- */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.content-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
    padding: 2rem 3rem;
    text-align: center;
    overflow: hidden;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

.content-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Forms --- */
.form-wrapper {
    max-width: 450px;
    margin: 0 auto;
}

h1 {
    color: var(--primary);
    margin: 0 0 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="url"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
    font-weight: 500;
}

button:hover {
    background: var(--secondary);
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.alert-danger {
    background: rgba(247,37,133,0.1);
    color: var(--danger);
    border: 1px solid rgba(247,37,133,0.2);
}

.alert-success {
    background: rgba(76,201,240,0.15);
    color: #0077b6;
    border: 1px solid rgba(76,201,240,0.3);
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f7fa;
}

.action-btn {
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    margin-right: 5px;
}

.btn-detail { background-color: var(--primary); }
.btn-delete { background-color: var(--danger); }

/* --- Details Page --- */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: left;
    margin-top: 2rem;
}

.detail-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.detail-card h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1rem;
    border-bottom: 2px solid rgba(67, 97, 238, 0.2);
    padding-bottom: 0.5rem;
}

.detail-card p {
    word-break: break-all;
    font-size: 0.95rem;
}

video {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* --- Redirect Page Styles --- */
.security-check {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
    overflow: hidden;
    position: relative;
}

/* --- Стили для футера (подвала) --- */

footer {
    background-color: #2c3e50; /* Темно-синий, стильный цвет */
    color: #ecf0f1; /* Светлый, приятный для глаз текст */
    padding: 2rem 1rem;
    text-align: center;
    margin-top: auto; /* Прижимает футер к низу страницы */
    width: 100%;
    box-sizing: border-box;
}

.footer-content p {
    margin: 0.5rem 0;
    color: #bdc3c7; /* Слегка приглушенный цвет для второстепенного текста */
}

.footer-content p.copyright {
    font-size: 0.9rem;
    color: #95a5a6; /* Еще более приглушенный цвет для копирайта */
    margin-top: 1.5rem;
}

.footer-content strong {
    color: #ffffff; /* Белый цвет для названия бренда */
    font-weight: 600;
}

.footer-links {
    margin: 1rem 0;
}

.footer-links a {
    color: #ecf0f1; /* Светлый цвет для ссылок */
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db; /* Ярко-синий при наведении */
}

.footer-links span {
    color: #7f8c8d; /* Цвет для разделителя */
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .footer-links span {
        display: none; /* Скрываем разделители на мобильных */
    }
}

/* --- Стили для прелоадера (экрана загрузки) --- */

.preloader {
    position: fixed; /* Фиксируем поверх всего контента */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Белый фон */
    z-index: 9999; /* Очень высокий z-index, чтобы быть поверх всех */
    
    /* Центрируем иконку внутри */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Стили для плавного исчезновения */
    transition: opacity 0.7s ease, visibility 0.7s ease;
    opacity: 1;
    visibility: visible;
}

/* Стили для иконки внутри прелоадера */
.preloader .fa-shield-alt {
    font-size: 6rem; /* Крупный размер иконки */
    color: var(--primary); /* Используем основной цвет бренда */
    animation: pulse 1.8s ease-in-out infinite; /* Применяем анимацию пульсации */
}

/* Когда прелоадер скрыт */
.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Анимация пульсации */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

.security-check::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.check-item {
    display: flex; align-items: center; padding: 0.8rem; margin: 0.5rem 0;
    background: rgba(0,0,0,0.03); border-radius: 8px; text-align: left;
    position: relative; overflow: hidden; transition: background 0.5s ease;
}
.check-item.completed { background: rgba(76,201,240,0.1); }
.check-item.failed { background: rgba(247,37,133,0.1); }
.icon {
    width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.1);
    display: flex; justify-content: center; align-items: center; margin-right: 1rem;
    flex-shrink: 0; transition: all 0.3s ease;
}
.check-item.completed .icon { background: var(--success); color: white; }
.check-item.failed .icon { background: var(--danger); color: white; }
.progress-container { height: 6px; background: rgba(0,0,0,0.05); border-radius: 3px; margin: 2rem 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width 0.5s ease; }
.spinner { border: 3px solid rgba(0,0,0,0.1); border-radius: 50%; border-top: 3px solid var(--primary); width: 20px; height: 20px; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }