/* Base Reset and Global Settings */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #6366f1;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-light: #6b7280;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-light: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --transition-default: all 0.3s ease;
    --radius-default: 1rem;
    --radius-sm: 0.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png') repeat;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #f8fafc;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: 1.2rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-default);
    position: relative;
    font-weight: 600;
}

a:hover {
    color: var(--secondary-color);
}

a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transition: var(--transition-default);
}

a:hover::after {
    width: 100%;
}

/* Header Styles */
header {
    padding: 2.5rem 0 1.5rem;
    width: 100%;
    position: relative;
}

header::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    rgba(99, 102, 241, 0.5),
    rgba(99, 102, 241, 0.3),
    transparent);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    text-align: center;
}

.logo-container {
    position: relative;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-glow {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(16, 185, 129, 0) 70%);
    animation: pulse 2s infinite;
    z-index: -1;
}

header img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
    transition: var(--transition-default);
    animation: glow 3s infinite;
}

header img:hover {
    transform: rotate(10deg) scale(1.1);
}

.highlight-element {
    position: relative;
    overflow: visible;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    max-width: 850px;
    background: linear-gradient(135deg, #f8fafc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
}

/* Ad Banner Styles */
.ad-banner {
    width: 100%;
    margin: 2rem 0;
    min-height: 120px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-default);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: var(--transition-default);
    position: relative;
}

.banner-icon {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    z-index: 2;
}

.banner-icon i {
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.sidebar-header {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sidebar-header i {
    color: var(--primary-color);
    font-size: 0.9rem;
    opacity: 0.8;
    animation: glow 3s infinite;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    white-space: nowrap;
    border-width: 0;
}

.ad-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    rgba(16, 185, 129, 0.4),
    rgba(99, 102, 241, 0.3),
    transparent);
}

.ad-banner::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.2),
    rgba(16, 185, 129, 0.3),
    rgba(99, 102, 241, 0.2),
    transparent);
}

.ad-banner:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.ad-top, .ad-bottom {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.ad-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}



/* Main Container */
.container {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    margin: 2rem auto;
    flex-grow: 1;
    max-width: 1400px;
    flex-wrap: nowrap;
    position: relative;
}

.container::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(16, 185, 129, 0.2),
    rgba(16, 185, 129, 0.4),
    rgba(16, 185, 129, 0.2),
    transparent);
    z-index: -1;
}

/* Main Content Area */
main {
    flex: 1;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-default);
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    min-width: 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    overflow-wrap: break-word;
    position: relative;
    color: #e2e8f0;
}

main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-default) var(--radius-default) 0 0;
}

main::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 3%;
    right: 3%;
    height: 10px;
    background: rgba(16, 185, 129, 0.2);
    filter: blur(10px);
    z-index: -1;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.75rem;
    margin: 2rem 0 1.2rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 1rem;
}

.article-content h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 4px;
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
}

.article-content h3 {
    font-size: 1.375rem;
    margin: 1.5rem 0 1rem;
    color: var(--accent-color);
    font-weight: 700;
    padding-left: 0.75rem;
    position: relative;
}

.article-content h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.25em;
    bottom: 0.25em;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-color), var(--primary-color));
    border-radius: 3px;
}

.article-date-bottom {
    text-align: right;
    font-size: 0.9rem;
    color: #777;
    margin-top: 20px;
}
.article-date-bottom time::before {
    content: "Дата публикации: ";
    font-weight: normal;
    color: #aaa;
}



.article-content p {
    margin-bottom: 1.5rem;
    color: #e2e8f0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition-default);
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Sidebar Styles */
.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.side-ad {
    position: sticky;
    top: 2rem;
    width: 100%;
    min-height: 600px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-default);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-shadow:
            0 10px 25px rgba(0, 0, 0, 0.2),
            inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    overflow: hidden;
    min-width: 190px;
    transition: var(--transition-default);
}

.side-ad::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(180deg,
    rgba(99, 102, 241, 0.7),
    rgba(16, 185, 129, 0.7),
    transparent);
}

.side-ad:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* Related Articles */
.related-articles {
    margin-top: 3.5rem;
    padding-top: 2rem;
    position: relative;
}

.related-articles::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    rgba(16, 185, 129, 0.4),
    rgba(99, 102, 241, 0.3),
    transparent);
}

.related-articles h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: #f8fafc;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.related-articles h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 2px;
    background: var(--secondary-color);
}

.related-articles ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.related-articles li {
    margin-bottom: 0;
    position: relative;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    transition: var(--transition-default);
    transform-origin: center;
}

.related-articles li:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.related-articles li::before {
    content: "→";
    position: absolute;
    left: 0.5rem;
    top: 1rem;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.related-articles a {
    font-weight: 600;
    line-height: 1.4;
    display: block;
    padding-left: 1rem;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
    color: #94a3b8;
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.2),
    rgba(99, 102, 241, 0.4),
    rgba(99, 102, 241, 0.2),
    transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.875rem;
    position: relative;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.footer-content a {
    color: var(--secondary-color);
    font-weight: 600;
    transition: var(--transition-default);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-content a:hover {
    color: var(--accent-color);
}

.footer-content i {
    font-size: 0.9rem;
}

.copyright {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.separator {
    color: rgba(99, 102, 241, 0.3);
    margin: 0 0.25rem;
}

/* SAPE Links Styling */
.sape-links {
    width: 100%;
    padding: 1rem 0;
    font-size: 0.875rem;
    text-align: center;
}

.sape-links a {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.35rem 0.75rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    transition: var(--transition-default);
}

.sape-links a:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sape-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.7));
    }
    100% {
        filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.5));
    }
}

/* Special Elements */
.highlight-box {
    position: relative;
    overflow: hidden;
}

.highlight-box::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transform: scale(1.5);
    transition: opacity 1s, transform 1s;
    pointer-events: none;
}

.highlight-box:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 1350px) {
    .container {
        gap: 2rem;
    }

    .sidebar {
        width: 200px;
    }

    main {
        max-width: 650px;
    }
}

@media (max-width: 1200px) {
    .container {
        gap: 1.75rem;
    }

    main {
        max-width: 600px;
    }

    .sidebar {
        width: 180px;
    }

    .related-articles ul {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
        margin-top: 1.5rem;
    }

    main {
        max-width: 800px;
        order: 1;
        margin-bottom: 2.5rem;
        padding: 2rem;
    }

    .sidebar {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }

    .sidebar-left {
        order: 2;
    }

    .sidebar-right {
        order: 3;
    }

    .side-ad {
        min-height: 200px;
        position: static;
        margin: 1.25rem 0;
        flex-direction: row;
        justify-content: center;
        padding: 1.5rem;
    }

    .side-ad::before {
        width: 100%;
        height: 2px;
        top: 0;
        left: 0;
        background: linear-gradient(90deg,
        rgba(99, 102, 241, 0.7),
        rgba(16, 185, 129, 0.7),
        transparent);
    }

    .sape-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .ad-banner::before,
    .ad-banner::after {
        left: 5%;
        right: 5%;
        width: 90%;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        padding: 0 16px;
    }

    header {
        padding: 2rem 0 1.25rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .ad-banner {
        min-height: 100px;
        padding: 1rem;
        margin: 1.5rem 0;
    }

    main {
        padding: 1.75rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .container {
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .related-articles ul {
        grid-template-columns: 1fr;
    }

    .related-articles li {
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: 0 12px;
    }

    header {
        padding: 1.5rem 0 1rem;
    }

    header h1 {
        font-size: 1.25rem;
        max-width: 100%;
    }

    main {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .ad-banner {
        min-height: 80px;
        margin: 1rem 0;
        padding: 0.75rem;
    }

    .article-content h2 {
        font-size: 1.4rem;
        padding-left: 0.75rem;
    }

    .article-content h2::before {
        width: 3px;
    }

    .article-content h3 {
        font-size: 1.375rem;
        margin: 1.5rem 0 1rem;
        color: var(--accent-color);
        font-weight: 700;
        padding-left: 0.75rem;
        position: relative;
    }

    .article-content h3::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.25em;
        bottom: 0.25em;
        width: 3px;
        background: linear-gradient(180deg, var(--accent-color), var(--primary-color));
        border-radius: 3px;
    }


    .related-articles {
        margin-top: 2.5rem;
        padding-top: 1.5rem;
    }

    .related-articles h3 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .related-articles li {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    .footer-content {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .ad-banner::before,
    .ad-banner::after,
    .container::before,
    .related-articles::before,
    footer::before {
        display: none;
    }
}



@media (max-width: 480px) {
    .article-date-bottom {
        text-align: left;
        font-size: 0.85rem;
        color: #94a3b8;
        margin-top: 1rem;
        padding: 0 0.5rem;
    }

    .article-date-bottom time::before {
        color: #cbd5e1;
        font-size: 0.85rem;
    }
}
