/* Общие стили */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --light-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --vk-color: #4C75A3;
    --telegram-color: #0088cc;
    --yandex-color: #FC3F1D;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9fafb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Шапка */
header {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.logo a:hover {
    color: var(--secondary-color);
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

nav a:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

nav a.active {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

/* Главная страница */
main {
    padding: 2rem 0;
}

.latest-articles,
.popular-articles {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 0.25rem;
    background-color: var(--primary-color);
    border-radius: 0.125rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.article-card h3 {
    padding: 1rem;
    margin: 0;
}

.article-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.2s;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-meta {
    padding: 0 1rem 1rem;
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.875rem;
}

.article-meta .date,
.article-meta .views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-meta .date::before {
    content: '📅';
}

.article-meta .views {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
}

/* Алерты */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

/* Подвал */
footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    text-align: center;
    color: #6b7280;
}

/* Адаптивность */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* Формы авторизации */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-container h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: var(--secondary-color);
}

.auth-container p {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
}

.auth-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-container a:hover {
    text-decoration: underline;
}

.error {
    padding: 0.75rem;
    background-color: #fee2e2;
    color: var(--error-color);
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Социальная авторизация */
.social-auth {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.social-auth p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.social-button:hover {
    opacity: 0.9;
}

.social-button.vk {
    background-color: var(--vk-color);
}

.social-button.telegram {
    background-color: var(--telegram-color);
}

.social-button.yandex {
    background-color: var(--yandex-color);
}
