/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    min-width: calc(100% - 100px); /* Safe zone of 100px */
}

.nav-logo h3 {
    color: #2563eb;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem; /* Reduced gap to save space */
}

/* Dropdown Menu Styles */
.nav-more-dropdown {
    position: relative;
}

.nav-more-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-more-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-more-dropdown:hover .nav-more-toggle i {
    transform: rotate(180deg);
}

.nav-more-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
}

.nav-more-dropdown:hover .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-more-menu li {
    margin: 0;
}

.nav-more-menu .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.nav-more-menu .nav-link:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.nav-more-menu .nav-link::after {
    display: none;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link.active {
    color: #2563eb;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    background: transparent;
    border: none;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
}

.hamburger:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.hamburger:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Prevent body scroll when mobile menu is open */
body.nav-open {
    overflow: hidden;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

/* News Info Section */
.news-info-section {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.news-info-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    background: #f8fafc;
    border-radius: 50px;
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
}

.info-item i {
    color: #2563eb;
    font-size: 1.1rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* News Section */
.news-section {
    padding: 4rem 0;
    background: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.news-card:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.news-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1;
}

.image-count i {
    font-size: 0.7rem;
}

.news-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover .news-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.overlay-content p {
    font-weight: 500;
}

.news-content {
    padding: 1.5rem;
}

.news-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.news-description {
    color: #6b7280;
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 0;
}

.news-modal-content {
    display: flex;
    flex-direction: column;
}

.news-modal-image {
    height: 300px;
    overflow: hidden;
}

.news-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
}

.single-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: center center;
}

.single-image-container img:hover {
    opacity: 0.9;
}

.single-image-container img.zoomed {
    cursor: move;
}

.single-image-container img.grabbing {
    cursor: grabbing;
}

.news-modal-info {
    padding: 2rem;
}

.news-modal-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.news-modal-text {
    color: #374151;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Image Gallery Styles */
.image-gallery {
    width: 100%;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: center center;
}

.gallery-main-image:hover {
    opacity: 0.9;
}

.gallery-main-image.zoomed {
    cursor: move;
}

.gallery-main-image.grabbing {
    cursor: grabbing;
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.zoom-controls-gallery {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 0.4rem;
    z-index: 3;
}

.zoom-btn-gallery {
    background: none;
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.zoom-btn-gallery:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zoom-level-gallery {
    color: white;
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.gallery-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    z-index: 2;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 2px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.gallery-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.gallery-thumbnail:hover {
    border-color: #2563eb;
    opacity: 0.8;
}

.gallery-thumbnail.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Fullscreen Viewer Styles */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.fullscreen-viewer.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    color: white;
    position: relative;
    z-index: 3001;
}

.fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 0.5rem;
}

.zoom-btn {
    background: none;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zoom-level {
    color: white;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
    font-weight: 500;
}

.fullscreen-counter {
    font-size: 1.1rem;
    font-weight: 500;
}

.fullscreen-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.fullscreen-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4rem;
}

.fullscreen-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.fullscreen-image.zoomed {
    cursor: move;
}

.fullscreen-image.grabbing {
    cursor: grabbing;
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-prev {
    left: 2rem;
}

.fullscreen-next {
    right: 2rem;
}

.fullscreen-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    justify-content: center;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.fullscreen-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.fullscreen-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.fullscreen-thumbnail.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* Loading and Empty States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    padding: 4rem 0;
    text-align: center;
}

.empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-content i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-content h3 {
    font-size: 1.5rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 2rem 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 1rem 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 12px 20px;
        display: block;
        border-radius: 8px;
        margin: 0 20px;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background-color: rgba(37, 99, 235, 0.1);
        transform: translateY(-2px);
    }

    /* Hide the "Еще" dropdown on mobile and show items directly */
    .nav-more-dropdown {
        display: none;
    }
    
    /* Show the hidden menu items directly in mobile menu */
    .nav-more-items {
        display: block !important;
    }
    
    /* Show the hidden menu items directly in mobile menu */
    .nav-more-items .nav-item {
        margin: 0.75rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-card {
        max-width: 100%;
    }
    
    .news-meta {
        justify-content: flex-end;
        gap: 0.75rem;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .news-modal-info {
        padding: 1.5rem;
    }
    
    .news-modal-image {
        height: 250px;
    }
    
    .gallery-main {
        height: 250px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
    }
    
    .gallery-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .fullscreen-main {
        padding: 0 2rem;
    }
    
    .fullscreen-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .fullscreen-prev {
        left: 1rem;
    }
    
    .fullscreen-next {
        right: 1rem;
    }
    
    .fullscreen-thumbnails {
        padding: 0.75rem 1rem;
    }
    
    .fullscreen-thumbnail {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .news-grid {
        gap: 1rem;
    }
    
    .news-content {
        padding: 1rem;
    }
    
    .news-title {
        font-size: 1.1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .news-modal-info {
        padding: 1rem;
    }
    
    .news-modal-text {
        font-size: 1rem;
    }
    
    .gallery-main {
        height: 200px;
    }
    
    .gallery-nav {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .gallery-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .fullscreen-header {
        padding: 0.75rem 1rem;
    }
    
    .fullscreen-main {
        padding: 0 1rem;
    }
    
    .fullscreen-nav {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .fullscreen-prev {
        left: 0.5rem;
    }
    
    .fullscreen-next {
        right: 0.5rem;
    }
    
    .fullscreen-thumbnails {
        padding: 0.5rem;
    }
    
    .fullscreen-thumbnail {
        width: 35px;
        height: 35px;
    }
}