:root {
    /* Default Colors */
    --bg-gradient-start: #0f0f23;
    --bg-gradient-mid1: #1a1a2e;
    --bg-gradient-mid2: #16213e;
    --bg-gradient-end: #1a1a2e;
    --card-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --text-color: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #cbd5e1;
    --accent-color: #4f46e5;
    --accent-secondary: #9333ea;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-color-light: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(79, 70, 229, 0.5);
    --particle-primary: rgba(79, 70, 229, 0.8);
    --particle-secondary: rgba(147, 51, 234, 0.6);
    --shadow-color: rgba(31, 38, 135, 0.37);
    --shadow-hover: rgba(31, 38, 135, 0.5);
    --glow-color: rgba(79, 70, 229, 0.3);
    --glow-strong: rgba(79, 70, 229, 0.6);
    --tag-bg: rgba(79, 70, 229, 0.15);
    --glow-color: rgba(79, 70, 229, 0.3);
    --modal-bg: rgba(62, 52, 78, 0.25);
    --modal-overlay: rgba(0, 0, 0, 0.5);
}

@font-face {
    font-family: 'DrukWideCyr';
    src: url('../assets/fonts/DrukWideCyr-Medium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg,
        var(--bg-gradient-start) 0%,
        var(--bg-gradient-mid1) 25%,
        var(--bg-gradient-mid2) 75%,
        var(--bg-gradient-end) 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Particle Background */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle,
        var(--particle-primary),
        var(--particle-secondary),
        transparent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--glow-color);
}

.particle:nth-child(1) { top: 20%; left: 10%; animation: float-up 8s linear infinite; }
.particle:nth-child(2) { top: 60%; left: 20%; animation: float-up 12s linear infinite; }
.particle:nth-child(3) { top: 40%; left: 70%; animation: float-up 10s linear infinite; }
.particle:nth-child(4) { top: 80%; left: 80%; animation: float-up 15s linear infinite; }
.particle:nth-child(5) { top: 30%; left: 50%; animation: float-up 9s linear infinite; }
.particle:nth-child(6) { top: 70%; left: 30%; animation: float-up 11s linear infinite; }
.particle:nth-child(7) { top: 10%; left: 90%; animation: float-up 13s linear infinite; }
.particle:nth-child(8) { top: 90%; left: 60%; animation: float-up 7s linear infinite; }
.particle:nth-child(9) { top: 50%; left: 85%; animation: float-up 14s linear infinite; }
.particle:nth-child(10) { top: 25%; left: 15%; animation: float-up 16s linear infinite; }
.particle:nth-child(11) { top: 75%; left: 25%; animation: float-up 6s linear infinite; }
.particle:nth-child(12) { top: 35%; left: 75%; animation: float-up 18s linear infinite; }
.particle:nth-child(13) { top: 65%; left: 5%; animation: float-up 8s linear infinite; }
.particle:nth-child(14) { top: 15%; left: 40%; animation: float-up 12s linear infinite; }
.particle:nth-child(15) { top: 85%; left: 45%; animation: float-up 10s linear infinite; }
.particle:nth-child(16) { top: 45%; left: 95%; animation: float-up 14s linear infinite; }
.particle:nth-child(17) { top: 55%; left: 55%; animation: float-up 11s linear infinite; }
.particle:nth-child(18) { top: 25%; left: 65%; animation: float-up 9s linear infinite; }
.particle:nth-child(19) { top: 75%; left: 75%; animation: float-up 13s linear infinite; }
.particle:nth-child(20) { top: 5%; left: 25%; animation: float-up 15s linear infinite; }

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

h1 {
    font-family: 'DrukWideCyr', sans-serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px var(--glow-color);
    border-color: var(--border-hover);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow:
        0 8px 32px var(--shadow-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeInCard 0.6s ease-out backwards;
    cursor: pointer;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.news-card:hover::before {
    left: 100%;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 40px var(--shadow-hover),
        0 0 30px var(--glow-color);
    border-color: var(--border-hover);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg-gradient-mid1);
    transition: transform 0.3s ease;
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-content {
    padding: 1.5rem;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.news-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
    line-height: 1.3;
}

.news-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 1rem;
}

.news-description {
    color: var(--text-tertiary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-tag {
    padding: 0.4rem 0.8rem;
    background: var(--tag-bg);
    border: 1px solid var(--glow-color);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.news-tag:hover {
    background: var(--accent-color);
    color: var(--text-color);
    transform: scale(1.05);
}

/* Modal Styles */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.news-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
    align-items: center;
    justify-content: center;
}

.news-modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(10px);
    z-index: 999;
    cursor: pointer;
}

.news-modal-bg.show {
    display: block;
    animation: modalbgFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalbgFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: var(--modal-bg);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    border: 1px solid var(--border-color);
    box-shadow:
        0 8px 32px var(--shadow-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: var(--text-color);
    font-size: 1.5rem;
}

.modal-close:hover {
    background: var(--accent-color);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 20px var(--glow-color);
}

.modal-image-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-gradient-mid1);
}

.modal-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, var(--modal-bg), transparent);
}

.modal-body {
    padding: 2rem;
}

.modal-body.no-image {
    padding-top: 3rem;
}

.modal-title {
    font-family: 'DrukWideCyr', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-date {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-date i {
    color: var(--accent-color);
}

.modal-description {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    white-space: pre-line;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.modal-tags .news-tag {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 3rem;
    color: #ff6b6b;
    font-size: 1.2rem;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none;
    }
    h1 {
        animation: none;
    }
    .news-title {
        animation: none;
    }
    .modal-title {
        animation: none;
    }
    .news-card {
        animation: none;
    }
    .news-grid {
        animation: none;
    }
    .modal-content {
        animation: none;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .container {
        padding: 1rem;
    }
    header {
        margin-bottom: 2rem;
    }
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    .modal-title {
        font-size: 1.8rem;
    }
    .modal-body {
        padding: 1.5rem;
    }
    .modal-image-container {
        max-height: 250px;
    }
}