/* Общие стили */
body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    color: #333;
    transition: background 0.3s, color 0.3s;
}

body.dark-theme {
    background: linear-gradient(135deg, #1e2a44, #2a3b5a);
    color: #ddd;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.main-content {
    flex: 3;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section {
    padding: 20px 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dark-theme .header {
    background: rgba(30, 42, 68, 0.9);
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.dark-theme .nav a {
    color: #ddd;
}

.nav a:hover {
    color: #00c6ff;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.theme-btn, .admin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #555;
    transition: color 0.3s;
}

.dark-theme .theme-btn, .dark-theme .admin-btn {
    color: #ddd;
}

.theme-btn:hover, .admin-btn:hover {
    color: #00c6ff;
}

/* Герой-секция */
.hero {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    border-radius: 16px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dark-theme .hero {
    background: linear-gradient(135deg, #1e90ff, #4682b4);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #fff;
    color: #0072ff;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.3s;
}

.dark-theme .btn {
    background: #2a3b5a;
    color: #00c6ff;
}

.btn:hover {
    transform: translateY(-2px);
    background: #e0f7ff;
}

.dark-theme .btn:hover {
    background: #3b5278;
}

.btn.secondary {
    background: transparent;
    color: #0072ff;
    box-shadow: none;
}

.dark-theme .btn.secondary {
    color: #00c6ff;
}

.news-button-wrapper {
    margin-top: 30px;
    text-align: center;
}

/* Карточки */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dark-theme .card {
    background: #2a3b5a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.project-grid, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Аватар */
.intro-content, .about-content, .contacts-content {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dark-theme .intro-content, .dark-theme .about-content, .dark-theme .contacts-content {
    background: rgba(42, 59, 90, 0.8);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0072ff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1 / 1; /* Гарантирует идеально круглую форму */
}

.dark-theme .avatar {
    border-color: #00c6ff;
}

/* Виджет погоды */
.weather-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-theme .weather-card {
    background: #2a3b5a;
}

/* Реклама */
.adsense-placeholder {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.dark-theme .adsense-placeholder {
    background: #3b5278;
}

.bottom-ads {
    max-width: 1200px;
    margin: 20px auto;
    text-align: center;
}

/* Соцсети */
.social-links {
    flex: 1;
}

.social-links a {
    color: #0072ff;
    text-decoration: none;
    margin-right: 10px;
}

.dark-theme .social-links a {
    color: #00c6ff;
}

/* Модальное окно админки */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dark-theme .modal-content {
    background: #2a3b5a;
}

.close {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

#admin-panel input, #admin-panel textarea {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.dark-theme #admin-panel input, .dark-theme #admin-panel textarea {
    background: #3b5278;
    color: #ddd;
    border-color: #666;
}

#news-list .news-item {
    background: #f0f0f0;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark-theme #news-list .news-item {
    background: #3b5278;
}

/* Подвал */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.dark-theme .footer {
    background: rgba(30, 42, 68, 0.9);
}

/* Улучшенная адаптивность */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 15px;
    }

    .main-content, .sidebar {
        flex: 1;
    }

    .hero {
        padding: 60px 15px;
        margin: 15px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .nav a {
        font-size: 16px;
        margin: 0 8px;
    }

    .header-controls {
        gap: 15px;
    }

    .theme-btn, .admin-btn {
        font-size: 20px;
    }

    .project-grid, .news-grid {
        grid-template-columns: 1fr;
    }

    .intro-content, .about-content, .contacts-content {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .news-button-wrapper {
        margin-top: 20px;
    }

    .bottom-ads {
        margin: 15px;
    }

    .card {
        padding: 15px;
    }

    .card img {
        height: 140px;
    }

    .card h3 {
        font-size: 18px;
    }

    .card p {
        font-size: 14px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 15px;
        max-width: 90%;
    }

    #admin-panel input, #admin-panel textarea {
        padding: 8px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 10px;
        margin: 10px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .card {
        padding: 12px;
    }

    .card img {
        height: 120px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 13px;
    }

    .nav a {
        font-size: 14px;
        margin: 0 5px;
    }

    .logo a {
        font-size: 20px;
    }

    .theme-btn, .admin-btn {
        font-size: 18px;
    }

    .avatar {
        width: 60px;
        height: 60px;
    }

    .intro-content p, .about-content p, .contacts-content p {
        font-size: 14px;
    }

    .weather-card {
        padding: 15px;
    }

    .weather-card p {
        font-size: 14px;
    }
}
