/* ==========================================================================
   Разработчик: Bulgakova Marina Andreevna
   Общие стили и сброс настроек
   ========================================================================== */
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}
body {
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==========================================================================
   Стили для Шапки (index.php, dashboard.php, admin.php)
   ========================================================================== */
header {
    background-color: #0056b3;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
header a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
header a:hover {
    color: #ffcc00;
}
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: bold;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

/* Главный заголовок на index.php */
h1 {
    text-align: center;
    margin-top: 30px;
    color: #0056b3;
    font-size: 2rem;
}

/* ==========================================================================
   СТИЛИ ДЛЯ СЛАЙДЕРА (index.php)
   ========================================================================== */
.slider {
    width: 100%;
    height: 400px; /* Высота слайдера */
    overflow: hidden;
    position: relative;
    margin: 30px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}
.slides {
    width: 100%;
    height: 100%;
    position: relative;
}
.slide {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Картинка заполняет область без искажений */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out; /* Плавное переключение за 1 секунду */
    z-index: 1;
}
.slide.active {
    opacity: 1;
    z-index: 2; /* Активный слайд становится поверх остальных */
}

/* ==========================================================================
   Стили для форм (register.php, login.php, apply.php)
   ========================================================================== */
.form-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 40px auto;
}
.form-box h2, .form-box h3 {
    margin-bottom: 15px;
    color: #0056b3;
}
label {
    font-weight: bold;
    color: #444;
    display: block;
    margin-top: 10px;
}
input, select, textarea {
    width: 100%;
    padding: 10px;
    margin: 6px 0 16px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
    border-color: #0056b3;
    outline: none;
}
button, .btn {
    background-color: #0056b3;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
button:hover, .btn:hover {
    background-color: #004085;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.error {
    color: #d9534f;
    background-color: #f2dede;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* ==========================================================================
   Таблицы и Личный кабинет (dashboard.php, admin.php)
   ========================================================================== */
h3 {
    color: #0056b3;
    margin-bottom: 10px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}
th {
    background-color: #e6f0fa;
    color: #0056b3;
    font-weight: bold;
}
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}
.status-new {
    background-color: #ffeeba;
    color: #856404;
}
.status-changed {
    background-color: #d4edda;
    color: #155724;
}

/* Пагинация */
.pagination {
    margin: 20px 0;
    display: flex;
    gap: 6px;
}
.pagination a {
    padding: 8px 14px;
    border: 1px solid #0056b3;
    text-decoration: none;
    color: #0056b3;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.2s;
}
.pagination a:hover, .pagination a.active {
    background: #0056b3;
    color: white;
}

/* ==========================================================================
   Адаптивный дизайн (Мобильные устройства до 450px, включая 390px)
   ========================================================================== */
@media (max-width: 450px) {
    .nav {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    h1 {
        font-size: 1.5rem;
        margin-top: 15px;
    }
    .form-box {
        padding: 20px;
        margin: 20px auto;
    }
    .slider {
        height: 220px; /* Уменьшаем высоту слайдера на смартфонах */
    }
    
    /* Адаптивное превращение таблиц в блоки-карточки */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr { 
        border: 1px solid #ccc; 
        margin-bottom: 10px;
        border-radius: 6px;
        background: #fff;
        padding: 5px;
    }
    td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50%; 
        text-align: right;
    }
    td:last-child {
        border-bottom: none;
    }
    td:before { 
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #0056b3;
}
}