:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #DDD0C8;
    color: #323232;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: #323232;
    color: white;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 70px;
    gap: 60px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 1.8em;
    color: #DDD0C8;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 60px;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 10px 0;
}

.nav-links a:hover {
    color: #DDD0C8;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.login-btn {
    background: transparent;
    border: 2px solid #DDD0C8;
    color: #DDD0C8;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.login-btn:hover {
    background: #DDD0C8;
    color: #323232;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #DDD0C8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #323232;
    font-weight: bold;
    overflow: hidden;
    position: relative;
    border: 2px solid #DDD0C8;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-text {
    font-size: 1.1em;
    font-weight: 600;
}

.user-name {
    color: white;
    font-weight: 500;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 10px 0;
    min-width: 200px;
    z-index: 1000;
    margin-top: 15px;
}

.user-profile.active .user-dropdown {
    display: block;
}

.user-dropdown-item {
    padding: 10px 15px;
    color: #323232;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
}

.user-dropdown-item:hover {
    background: #f5f5f5;
}

.user-dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

/* Breadcrumbs */
.breadcrumbs {
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 10px;
    font-size: 0.9em;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: #323232;
}

.breadcrumb-separator {
    color: #999;
}

.breadcrumb-current {
    color: #323232;
    font-weight: 500;
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    width: 100%;
    gap: 40px;
    flex: 1;
    min-height: calc(100vh - 140px);
}

.content-wrapper {
    display: flex;
    gap: 40px;
    margin: 40px 0;
    flex: 1;
}

.article-wrapper {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
}

/* Article Content */
.article-content h1 {
    font-family: 'PT Serif', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.featured-image:hover img {
    transform: scale(1.02);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.tag {
    background-color: var(--background-alt);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.tag:hover {
    background-color: var(--primary);
    color: white;
    cursor: pointer;
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-family: 'PT Serif', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem 0;
    color: var(--text);
    line-height: 1.3;
}

.article-body h3 {
    font-family: 'PT Serif', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: var(--text);
    line-height: 1.3;
}

/* Share Section */
.share-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 3rem 0;
    padding: 1.5rem;
    background-color: var(--background-alt);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.share-title {
    font-weight: 600;
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-vk {
    background-color: #4c75a3;
}

.share-ok {
    background-color: #ee8208;
}

.share-telegram {
    background-color: #2aabee;
}

.share-whatsapp {
    background-color: #25d366;
}

/* Rating and Stats */
.rating-section {
    margin-bottom: 3rem;
}

.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 1.5rem;
    background-color: var(--background-alt);
    border-radius: var(--radius);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

.stat-icon {
    color: var(--primary);
}

.stat-number {
    font-weight: 500;
}

/* Related Articles */
.related-articles {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.article-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background-color: var(--background);
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.875rem;
}

.image-blur {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.article-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    color: white;
}

.article-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.article-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: white;
}

/* Main Articles Grid */
.articles-grid-main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.article-card-main {
    background: white;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-card-main:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.article-image-container-main {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #DDD0C8 0%, #c3cfe2 100%);
}

.article-image-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card-main:hover .article-image-main {
    transform: scale(1.05);
}

.image-overlay-main {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    padding: 15px;
}

.overlay-content-main {
    color: white;
    width: 100%;
}

.article-category-main {
    font-size: 0.8em;
    color: #DDD0C8;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title-overlay-main {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.article-footer-main {
    padding: 15px;
    background: white;
}

.article-meta-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: #666;
}

.article-date-main {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.article-stats-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-main {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.article-rating-main {
    display: flex;
    align-items: center;
    gap: 3px;
}

.rating-star-main {
    color: #ffc107;
    font-size: 0.8em;
}

.rating-value-main {
    font-size: 0.75em;
    font-weight: 600;
    color: #666;
    margin-left: 2px;
}

/* Profile Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.profile-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-section h3 {
    color: #444;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.avatar-section {
    text-align: center;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    overflow: hidden;
    position: relative;
}

.avatar-preview i {
    font-size: 60px;
    color: #6c757d;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.avatar-info {
    text-align: center;
}

.avatar-info p {
    margin: 0;
    color: #6c757d;
}

.username-section {
    max-width: 400px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

.form-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.current-info {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Sidebar */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    margin-left: auto;
}

.ad-container {
    position: sticky;
    top: 90px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    height: 500px;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9em;
    border: 2px dashed #ddd;
}

/* Footer */
.footer {
    background: #323232;
    color: white;
    padding: 25px 20px 12px;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.footer-logo {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    gap: 50px;
}

.footer-column h4 {
    margin-bottom: 10px;
    color: #DDD0C8;
    font-size: 1em;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 5px;
}

.footer-column a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: #DDD0C8;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 12px;
    text-align: center;
    color: #999;
    font-size: 0.8em;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #323232;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #323232;
}

.modal-content {
    padding: 20px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #323232;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background: #555;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-switch a {
    color: #3498db;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.loading-indicator {
    text-align: center;
    padding: 30px;
    color: #666;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: #DDD0C8;
}

.empty-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #323232;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: -1;
        margin-left: 0;
    }
    
    .ad-container {
        position: static;
        margin-bottom: 30px;
        height: 200px;
    }

    .articles-grid-main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 20px;
    }

    .nav-links {
        margin: 0;
        gap: 40px;
    }

    .auth-section {
        margin-left: 0;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 20px;
        margin: 20px 0;
    }

    .article-wrapper {
        max-width: 100%;
    }

    .article-content h1 {
        font-size: 2rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .share-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .stats-container {
        gap: 15px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid-main {
        grid-template-columns: 1fr;
    }

    .article-image-container-main {
        height: 200px;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }

    .footer-links {
        gap: 30px;
        flex-wrap: wrap;
    }

    .user-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 15px 15px 0 0;
        margin: 0;
    }

    .profile-container {
        padding: 10px;
    }
    
    .profile-section {
        padding: 20px;
    }
    
    .avatar-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .avatar-controls button {
        width: 200px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 0 15px;
    }

    .nav-links {
        gap: 25px;
    }

    .article-content h1 {
        font-size: 1.75rem;
    }

    .article-body h2 {
        font-size: 1.5rem;
    }

    .article-body h3 {
        font-size: 1.25rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links {
        gap: 20px;
    }

    .article-meta-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .article-stats-main {
        width: 100%;
        justify-content: space-between;
    }
}