/* Mobile First стили (сначала для мобильных) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    width: 100%;
    padding: 0 15px;
}

/* Header Styles для мобильных */
.header {
    background-color: #2c3e50;
    color: white;
    width: 100%;
}

.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #34495e;
}

.logo img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.site-title {
    text-align: center;
    font-size: 1.5em;
    margin: 0;
}

/* Навигация для мобильных */
.nav {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 15px;
    border-bottom: 1px solid #34495e;
    text-align: center;
    transition: background-color 0.3s;
}

.nav-link:last-child {
    border-bottom: none;
}

.nav-link:hover {
    background-color: #34495e;
}

/* Main Content для мобильных */
.main {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.section {
    margin-bottom: 30px;
    width: 100%;
}

.section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    font-size: 1.3em;
}

/* Порядок отображения для мобильных */
.table-section {
    order: 1;
}

.links-section {
    order: 2;
}

.form-section {
    order: 3;
}

/* Links List для мобильных */
.links-list {
    list-style-type: none;
}

.links-list li {
    margin-bottom: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
}

.links-list a {
    color: #2980b9;
    text-decoration: none;
    word-break: break-word;
}

.links-list a:hover {
    text-decoration: underline;
}

.links-list img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Table Styles для мобильных */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    overflow-x: auto;
    display: block;
}

.data-table th,
.data-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.data-table th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.data-table tbody tr:hover {
    background-color: #e3f2fd;
}

/* Form Styles для мобильных */
.form {
    width: 100%;
    margin-top: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.submit-btn {
    background-color: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #2980b9;
}

/* Footer Styles */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.footer p {
    margin: 0;
}

/* Media Query для планшетов (768px и выше) */
@media (min-width: 768px) {
    .container {
        max-width: 960px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Header для планшетов и десктопов */
    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
    }
    
    .logo img {
        margin-bottom: 0;
    }
    
    .site-title {
        font-size: 2.5em;
        text-align: center;
        flex-grow: 1;
    }
    
    /* Навигация для планшетов и десктопов */
    .nav {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
        border-top: 1px solid #34495e;
        padding-top: 15px;
    }
    
    .nav-link {
        border-bottom: none;
        padding: 10px 15px;
        border-radius: 4px;
    }
    
    /* Main Content для планшетов и десктопов */
    .main {
        padding: 40px 0;
    }
    
    .section {
        margin-bottom: 50px;
    }
    
    .section h2 {
        font-size: 1.8em;
        padding-bottom: 10px;
    }
    
    /* Возвращаем нормальный порядок для больших экранов */
    .table-section {
        order: 0;
    }
    
    .links-section {
        order: 0;
    }
    
    .form-section {
        order: 0;
    }
    
    /* Table Styles для планшетов и десктопов */
    .data-table {
        font-size: 16px;
        display: table;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px;
    }
    
    /* Form Styles для планшетов и десктопов */
    .form {
        max-width: 600px;
        margin-top: 20px;
    }
    
    .radio-group {
        flex-direction: row;
        gap: 20px;
    }
    
    .submit-btn {
        width: auto;
    }
    
    .site-title {
        padding: 30px 0;
    }
}

/* Media Query для десктопов (1024px и выше) */
@media (min-width: 1024px) {
    .header-top {
        padding: 20px 0;
    }
    
    .nav {
        gap: 40px;
        padding-top: 20px;
    }
    
    .main {
        padding: 50px 0;
    }
    
    .section h2 {
        font-size: 2em;
    }
    
    /* Улучшения для больших экранов */
    .links-list li {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .site-title {
        font-size: 1.3em;
    }
    
    .section h2 {
        font-size: 1.2em;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px;
    }
    
    .nav-link {
        padding: 12px;
    }
}