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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.header h1 {
    margin-bottom: 0;
    color: #2c3e50;
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

h3 {
    color: #7f8c8d;
    margin-bottom: 15px;
}

h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ecf0f1;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="date"],
input[type="password"],
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: #3498db;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.main-form {
    max-width: 500px;
    margin: 0 auto 40px;
}

.schedule-info {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    text-align: center;
}

.schedule-info p {
    margin-bottom: 10px;
    font-size: 18px;
}

.pairs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pair-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.time-display {
    background: #34495e;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

.teacher-new {
    margin-top: 8px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.nav-links {
    text-align: center;
    margin-top: 30px;
}

.nav-links .btn {
    margin: 0 10px 10px 0;
}

.management-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.add-form {
    display: flex;
    gap: 10px;
    align-items: end;
}

.add-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.teachers-list {
    list-style: none;
}

.teachers-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 4px solid #27ae60;
}

.day-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.time-item {
    display: flex;
    flex-direction: column;
}

.time-item label {
    margin-bottom: 5px;
    font-weight: normal;
}

.time-form {
    margin-bottom: 20px;
}

/* Новые стили для улучшенного интерфейса */
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.mode-tab {
    padding: 12px 24px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.mode-tab.active {
    background: #3498db;
    color: white;
}

.mode-tab:hover {
    background: #2980b9;
    color: white;
}

.mode-content {
    display: none;
    margin-bottom: 30px;
}

.mode-content.active {
    display: block;
}

.date-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-date {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 80px;
}

.btn-date:hover {
    background: #f8f9fa;
}

.btn-date.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.admin-panel {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #e74c3c;
    text-align: center;
}

.schedule-display {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 2px solid #ecf0f1;
}

.teacher-schedule {
    margin-top: 30px;
}

.teacher-day {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #9b59b6;
}

.pair-item {
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pair-item.class-hour {
    border-left-color: #e67e22;
    background: #fffaf0;
}

.pair-item.teacher-pair {
    background: #f0f8ff;
    border-left-color: #9b59b6;
}

.no-pairs {
    padding: 30px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.schedule-header {
    background: #34495e;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.pair-time {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.pair-subject {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.pair-details {
    color: #7f8c8d;
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pairs-container {
        grid-template-columns: 1fr;
    }
    
    .add-form {
        flex-direction: column;
    }
    
    .teachers-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .mode-tab {
        min-width: auto;
    }
    
    .date-navigation {
        flex-direction: column;
    }
    
    .nav-links .btn {
        display: block;
        margin: 5px 0;
        width: 100%;
    }
}