* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



/* Полупрозрачный фон для основных блоков, чтобы текст был читаемым */
.section-card,
.topic-card,
.subject-card,
.admin-card,
.welcome-header,
.profile-container,
.result-container,
.test-container,
.theory-container .content-section,
.test-section,
.ai-assistant,
.rating-table,
.students-table,
.topics-container,
.form-container {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Шапка и навигация могут быть непрозрачными или полупрозрачными */
header, nav {
    background: rgba(44, 62, 80, 0.95);
}

main {
    flex: 1;
}

/* Стили для таблиц */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

tr:hover {
    background: #f5f5f5;
}

/* Стили для карточек предметов */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.subject-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.subject-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.subject-card a {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.subject-card a:hover {
    background: #2980b9;
}

/* Стили для форм */
input, select, textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

button:hover {
    opacity: 0.9;
}

/* Стили для ошибок и уведомлений */
.error {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

.success {
    background: #27ae60;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    nav a {
        text-align: center;
        margin: 2px 0;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    table, th, td {
        font-size: 12px;
        padding: 8px;
    }
}

/* Стили для теории */
.theory-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.6;
    margin: 20px 0;
    border-left: 4px solid #3498db;
}

/* Стили для таймера */
#timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e67e22;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Стили для вопросов теста */
fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: white;
}

legend {
    font-weight: bold;
    padding: 0 10px;
    color: #2c3e50;
}

