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

:root {
    --color-bg-dark: #0f1419;
    --color-bg-card: #1a1f2e;
    --color-primary: #4a7c99;
    --color-primary-light: #6b9db8;
    --color-accent: #2a5a7a;
    --color-text: #e4e6eb;
    --color-text-secondary: #a0a6b3;
    --color-border: #2a3f52;
    --color-hover: #5a8ca9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, #1a2332 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(180deg, var(--color-bg-card) 0%, var(--color-accent) 100%);
    border-right: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar h1 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    color: var(--color-primary-light);
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 1.5rem;
}

.sidebar-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sidebar-nav a:hover {
    color: var(--color-primary-light);
    transform: translateX(4px);
}

main {
    margin-left: 220px;
    padding: 2rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary-light);
    font-weight: 700;
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    aspect-ratio: 1;
}

.gallery-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(74, 124, 153, 0.3);
    transform: scale(1.04);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.12);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 124, 153, 0.8) 0%, rgba(42, 90, 122, 0.9) 100%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    text-align: center;
    padding: 1.5rem;
    gap: 0.8rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.overlay-text {
    font-size: 0.85rem;
    color: rgba(228, 230, 235, 0.8);
}

footer {
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    text-align: center;
    padding: 2.5rem;
    margin-left: 220px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

footer p {
    margin: 0.6rem 0;
}

/* Адаптивный дизайн для планшета */
@media (max-width: 1024px) {
    .sidebar {
        width: 180px;
        padding: 1.5rem 1rem;
    }

    .sidebar h1 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

    main {
        margin-left: 180px;
        padding: 1.5rem;
    }

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

    .page-header h2 {
        font-size: 1.8rem;
    }

    footer {
        margin-left: 180px;
        padding: 2rem;
    }
}

/* Адаптивный дизайн для мобильного */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .sidebar h1 {
        margin-bottom: 1rem;
        font-size: 1.4rem;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .sidebar-nav li {
        margin: 0;
    }

    main {
        margin-left: 0;
        padding: 1rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .gallery-overlay {
        padding: 1rem;
    }

    .overlay-title {
        font-size: 0.9rem;
    }

    .overlay-text {
        font-size: 0.75rem;
    }

    footer {
        margin-left: 0;
    }
}

/* Адаптивный дизайн для маленького экрана */
@media (max-width: 480px) {
    .sidebar h1 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .sidebar-nav li {
        margin-bottom: 1rem;
    }

    .sidebar-nav a {
        font-size: 0.85rem;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .page-header h2 {
        font-size: 1.3rem;
        margin-bottom: 0.3rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    main {
        padding: 0.8rem;
    }

    footer {
        padding: 1.5rem;
        font-size: 0.8rem;
    }

    footer p {
        margin: 0.3rem 0;
    }
}

/* Скролл для боковой панели */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}