/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    font-size: 16px;
    min-width: 340px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

header p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Навигация */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    display: inline-block;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Секции */
section {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

h2 {
    color: #1a2980;
    border-bottom: 3px solid #26d0ce;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #1a2980;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Форма добавления данных */
.add-form-container {
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

input.error, select.error {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.error-message {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add {
    background-color: #38a169;
    color: white;
}

.btn-add:hover {
    background-color: #2f855a;
    transform: translateY(-2px);
}

.btn-reset {
    background-color: #a0aec0;
    color: white;
}

.btn-reset:hover {
    background-color: #718096;
}

.btn-delete {
    background-color: #e53e3e;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background-color: #c53030;
}

.btn-clear {
    background-color: #ed8936;
    color: white;
    padding: 10px 20px;
    margin-right: 15px;
}

.btn-clear:hover {
    background-color: #dd6b20;
}

.form-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    display: none;
}

.form-message.success {
    background-color: #c6f6d5;
    color: #22543d;
    display: block;
}

.form-message.error {
    background-color: #fed7d7;
    color: #742a2a;
    display: block;
}

/* Секция с изображением */
.intro-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.intro-text {
    flex: 1;
}

.intro-image {
    flex: 1;
    text-align: center;
}

.intro-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* Текстовые элементы */
p {
    margin-bottom: 15px;
    line-height: 1.7;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    line-height: 1.5;
}

strong {
    color: #1a2980;
}

/* Таблица */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    min-width: 500px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #1a2980;
    color: white;
    font-weight: 600;
}

/* Заливка для нечетных строк таблицы */
tbody tr:nth-child(odd) {
    background-color: #f8fafc;
}

tbody tr:hover {
    background-color: #f0f7ff;
}

.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
}

.table-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
    flex: 1;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

#rowCount {
    font-weight: 600;
    color: #1a2980;
}

/* Карточки с ссылками */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.link-card {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.link-card h3 {
    color: #1a2980;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.link-card p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.link-card a {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.external-link {
    background-color: #1a2980;
    color: white;
}

.email-link {
    background-color: #26d0ce;
    color: white;
}

.phone-link {
    background-color: #4CAF50;
    color: white;
}

.link-card a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.resources-intro {
    margin-top: 30px;
    font-weight: 600;
}

.resources-list {
    margin-top: 10px;
}

.resources-list a {
    color: #1a2980;
    text-decoration: none;
    font-weight: 600;
}

.resources-list a:hover {
    text-decoration: underline;
}

/* Подвал */
footer {
    background-color: #1a2980;
    color: white;
    text-align: center;
    padding: 25px 15px;
    margin-top: 30px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

footer p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.footer-nav {
    margin-top: 15px;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
    font-weight: 600;
}

.footer-nav a:hover {
    text-decoration: underline;
}

/* Адаптация для планшетов (от 768px) */
@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .intro-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 30px;
    }
    
    .form-row {
        flex-direction: row;
    }
    
    .links-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .link-card {
        flex: 1;
        min-width: 250px;
    }
    
    nav ul {
        gap: 25px;
    }
}

/* Адаптация для десктопов (от 1024px) */
@media (min-width: 1024px) {
    body {
        font-size: 17px;
    }
    
    section {
        padding: 30px;
    }
    
    th, td {
        padding: 15px;
    }
    
    .link-card {
        min-width: 0;
    }
}

/* Адаптация для очень маленьких экранов (340px - 480px) */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    section {
        padding: 20px 15px;
    }
    
    nav ul {
        gap: 10px;
    }
    
    nav a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .link-card {
        padding: 15px;
    }
    
    .link-card a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    footer {
        padding: 20px 10px;
    }
}

/* Адаптация для экстремально маленьких экранов (340px и меньше) */
@media (max-width: 340px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    nav a {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    table {
        min-width: 320px;
    }
}