/* ===== STARYE STILI IZ ASSIGNMENT #2 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #0a0a0a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a, button, input, select {
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== NOVYE FLEXBOX STILI DLYA ASSIGNMENT #3 ===== */

/* FLEXBOX NAVIGATION - Task 1 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 2px solid #8b0000;

    /* FLEXBOX PROPERTIES */
    display: flex;
    justify-content: center;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

    /* FLEXBOX PROPERTIES */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-text {
    color: #ff4444;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(255, 68, 68, 0.3);
    letter-spacing: 2px;
}

.nav-menu {
    list-style: none;

    /* FLEXBOX PROPERTIES */
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

/* FLEXBOX CARDS - Task 2 */
.cards-container {
    /* FLEXBOX PROPERTIES */
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 1.5rem;
    width: 300px;

    /* FLEXBOX PROPERTIES */
    display: flex;
    flex-direction: column;

    /* EQUAL HEIGHT */
    min-height: 400px;

    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(255, 68, 68, 0.3);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card h3 {
    color: #ff4444;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.card p {
    color: #b0b0b0;

    /* FLEXBOX FOR EQUAL HEIGHT */
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-btn {
    display: inline-block;
    background: #ff4444;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid #ff4444;
    font-weight: 500;
    text-align: center;

    /* FLEXBOX ALIGNMENT */
    align-self: flex-start;
    margin-top: auto;
}

.card-btn:hover {
    background: transparent;
    color: #ff4444;
    transform: scale(1.05);
}

/* ===== GRID SYSTEM - Task 3 ===== */

/* GRID LAYOUT FOR PAGES */
.grid-layout {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main"
        "footer footer";
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    margin-top: 80px; /* For fixed navbar */
}

.grid-header {
    grid-area: header;
    background: #1a1a1a;
    padding: 2rem;
    border-bottom: 2px solid #8b0000;
}

.grid-sidebar {
    grid-area: sidebar;
    background: #151515;
    padding: 2rem;
    border-right: 1px solid #333;
}

.grid-main {
    grid-area: main;
    padding: 2rem;
    background: #0f0f0f;
}

.grid-footer {
    grid-area: footer;
    background: #1a1a1a;
    padding: 2rem;
    text-align: center;
    border-top: 2px solid #8b0000;
}

/* SIDEBAR CONTENT */
.sidebar-content h3 {
    color: #ff4444;
    margin-bottom: 1.5rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #333;
    color: #b0b0b0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.sidebar-menu li:hover {
    color: #ff4444;
}

/* ===== GRID GALLERY - Task 4 ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay {
    transform: translateY(0);
}

.overlay h3 {
    color: #ff4444;
    margin-bottom: 0.5rem;
}

.overlay p {
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* ===== STARYE STILI IZ ASSIGNMENT #2 (SOHRANYAEM) ===== */

#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://p325k7wa.twic.pics/high/dark-souls/dark-souls-3/00-page-setup/ds3_game-thumbnail.jpg?twic=v1/resize=700/step=10/quality=80') center/cover fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
    animation: fadeInUp 1.5s ease;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
    letter-spacing: 3px;
    position: relative;
}

.hero-title::before {
    content: "⚔";
    position: absolute;
    left: -50px;
    color: #ff4444;
    opacity: 0.3;
}

.hero-title::after {
    content: "⚔";
    position: absolute;
    right: -50px;
    color: #ff4444;
    opacity: 0.3;
    transform: scaleX(-1);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #e0e0e0;
    max-width: 600px;
    margin: 0 auto;
}

.main-content {
    padding-top: 80px;
}

.info-section, .categories-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.categories-section {
    background-color: #0f0f0f;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
    align-items: center;
}

.info-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(255, 68, 68, 0.2);
    transition: transform 0.3s ease;
}

.info-image img.circular {
    border-radius: 50%;
    width: 300px;
    height: 300px;
}

.info-image img:hover {
    transform: scale(1.05);
}

.info-text h2, .section-title {
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 68, 68, 0.2);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.features-list {
    list-style: none;
}

.features-list li {
    color: #b0b0b0;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}

.features-list li::before {
    content: "⚔";
    position: absolute;
    left: 0;
    color: #ff4444;
}

.categories-grid, .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.category-card, .game-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card {
    padding: 0;
    overflow: hidden;
    text-align: left;
}

.category-card:hover, .game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 68, 68, 0.3);
}

.category-image, .game-image {
    height: 200px;
    margin-bottom: 20px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
}

.game-image {
    margin: 0;
    border-radius: 0;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 20px;
}

.anime-bg {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://igm.gg/_next/image?url=https%3A%2F%2Fstorage.yandexcloud.net%2Figm-s3%2FPROD%2F202408%2F5cbad147%2FCODE_VEIN_2_11zon.png&w=640&q=75');
}

.platformer-bg {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://korobok.store/upload/iblock/596/hf2hbwwfovu1f9iyko2bw0ufx15g52cq.webp');
}

.metroidvania-bg {
    background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://assetsio.gnwcdn.com/Silksong_Walkthrough_Header.jpg?width=1200&height=1200&fit=crop&quality=100&format=png&enable=upscale&auto=webp');
}

.category-card h3, .game-title {
    color: #ff4444;
    margin-bottom: 15px;
}

.category-card p, .game-description {
    color: #b0b0b0;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    background: #ff4444;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid #ff4444;
    font-weight: 500;
}

.btn-primary:hover {
    background: transparent;
    color: #ff4444;
    transform: scale(1.05);
}

.game-category {
    display: inline-block;
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #ff4444;
}

.library-main {
    padding-top: 100px;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.library-title {
    text-align: center;
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 40px;
}

.search-form, .contact-form {
    display: flex;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto 60px;
    flex-wrap: wrap;
}

.contact-form {
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.search-input, .category-filter, .form-input, .form-textarea {
    flex: 1;
    padding: 15px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 5px;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
}

.search-input:focus, .category-filter:focus, .form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #ff4444;
    background: #2a2a2a;
    box-shadow: 0 0 5px rgba(255, 68, 68, 0.2);
}

.search-button, .form-button {
    padding: 15px 40px;
    background: #ff4444;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover, .form-button:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

.footer {
    background: #0a0a0a;
    border-top: 2px solid #8b0000;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #ff4444;
    margin-bottom: 20px;
}

.footer-section p, .footer-links a {
    color: #b0b0b0;
}

.footer-links {
    list-style: none;
}

.footer-links a {
    text-decoration: none;
}

.footer-links a:hover {
    color: #ff4444;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #808080;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
    }

    .info-content {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input, .category-filter, .search-button {
        width: 100%;
    }

    /* NEW RESPONSIVE FOR GRID LAYOUT */
    .grid-layout {
        grid-template-areas:
            "header"
            "main"
            "footer";
        grid-template-columns: 1fr;
    }

    .grid-sidebar {
        display: none;
    }

    .cards-container {
        flex-direction: column;
        align-items: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #ff4444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cc0000;
}
/* Добавленные стили для Flexbox и Grid */

/* Task 1: Flexbox Navigation */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Task 2: Flexbox Cards */
.flexbox-cards-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.flexbox-cards-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.flexbox-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 30px;
    width: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.flexbox-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(255, 68, 68, 0.3);
}

.flexbox-card-image {
    height: 200px;
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
}

.flexbox-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flexbox-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.flexbox-card h3 {
    color: #ff4444;
    margin-bottom: 15px;
}

.flexbox-card p {
    color: #b0b0b0;
    margin-bottom: 20px;
    flex: 1;
}

/* Task 3: Grid Layout with Areas */
.grid-layout-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.grid-container {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main"
        "footer footer";
    grid-template-columns: 1fr 3fr;
    grid-template-rows: auto 1fr auto;
    gap: 30px;
    min-height: 600px;
}

.grid-header {
    grid-area: header;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.grid-sidebar {
    grid-area: sidebar;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 30px;
    border-radius: 10px;
}

.grid-main {
    grid-area: main;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 30px;
    border-radius: 10px;
}

.grid-footer {
    grid-area: footer;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.grid-sidebar ul {
    list-style: none;
}

.grid-sidebar li {
    margin-bottom: 15px;
}

.grid-sidebar a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    padding: 8px 0;
}

.grid-sidebar a:hover {
    color: #ff4444;
    padding-left: 10px;
}

/* Task 4: Image Gallery with Grid */
.grid-gallery-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Search functionality styles */
.search-highlight {
    background-color: #ff4444;
    color: #fff;
    padding: 2px 4px;
    border-radius: 3px;
}

.no-results {
    text-align: center;
    color: #ff4444;
    font-size: 1.2rem;
    margin: 40px 0;
}

/* Contact page specific styles */
.contact-main {
    padding-top: 100px;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.contact-title {
    text-align: center;
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 40px;
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
    margin-bottom: 60px;
}

.contact-info h2 {
    color: #ff4444;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.contact-info p {
    color: #b0b0b0;
    margin-bottom: 30px;
    line-height: 1.8;
}

.contact-item {
    margin-bottom: 30px;
}

.contact-item h3 {
    color: #ff4444;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.contact-item p {
    color: #b0b0b0;
    margin-bottom: 0;
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link {
    color: #ff4444;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #ff4444;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ff4444;
    color: #fff;
}

.contact-form-container h2 {
    color: #ff4444;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #b0b0b0;
    margin-bottom: 8px;
    font-weight: 500;
}

/* About page specific styles */
.about-main {
    padding-top: 100px;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.about-title {
    text-align: center;
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 40px;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
    margin-bottom: 80px;
    align-items: start;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(255, 68, 68, 0.2);
}

.about-text h2 {
    color: #ff4444;
    margin: 30px 0 20px;
    font-size: 1.8rem;
}

.about-text p {
    color: #b0b0b0;
    margin-bottom: 20px;
    line-height: 1.8;
}

.team-section {
    padding: 60px 0;
    border-top: 1px solid #333;
}

.team-section h2 {
    text-align: center;
    color: #ff4444;
    margin-bottom: 40px;
    font-size: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.team-member {
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.member-image {
    margin-bottom: 20px;
}

.member-image img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.team-member h3 {
    color: #ff4444;
    margin-bottom: 10px;
}

.team-member p {
    color: #b0b0b0;
}

/* Responsive Grid Layout */
@media (max-width: 768px) {
    .grid-container {
        grid-template-areas:
            "header"
            "main"
            "sidebar"
            "footer";
        grid-template-columns: 1fr;
    }

    .grid-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}