/* Alapvető stílusok */
:root {
    /* Világos téma */
    --primary-color: #2ecc71;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --text-color: #2c3e50;
    --text-secondary: #666;
    --header-gradient: linear-gradient(120deg, #4e54c8 0%, #8754d8 50%, #da3e98 100%);
}

/* Sötét téma */
[data-theme="dark"] {
    --primary-color: #2ecc71;
    --secondary-color: #ecf0f1;
    --accent-color: #e74c3c;
    --background-color: #1a1a1a;
    --card-background: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --text-color: #ecf0f1;
    --text-secondary: #bdc3c7;
    --header-gradient: linear-gradient(135deg, #000000 0%, #0f2b4d 40%, #1e4d8b 100%);
}

/* Témaváltó gomb stílusai */
.theme-toggle {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    margin: 0 1rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-toggle-light,
.theme-toggle-dark {
    font-size: 1.2rem;
    line-height: 1;
}

/* Sötét témában csak a hold, világos témában csak a nap látszik */
[data-theme="dark"] .theme-toggle-light {
    display: none;
}

[data-theme="dark"] .theme-toggle-dark {
    display: block;
}

[data-theme="light"] .theme-toggle-light {
    display: block;
}

[data-theme="light"] .theme-toggle-dark {
    display: none;
}

/* Sötét téma stílusok */
:root[data-theme="dark"] .game-card {
    background-color: var(--card-background);
    border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .game-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .game-card-content h3 {
    color: var(--text-color);
}

:root[data-theme="dark"] .game-card-content p {
    color: var(--text-secondary);
}

:root[data-theme="dark"] .category-filters {
    background-color: var(--card-background);
    box-shadow: 0 2px 4px var(--shadow-color);
}

:root[data-theme="dark"] footer {
    background-color: var(--card-background);
    color: var(--text-color);
}

:root[data-theme="dark"] .header-stats {
    background: rgba(15, 20, 60, 0.95) !important;
}

:root[data-theme="dark"] #total-games {
    background: rgba(255,255,255,0.15);
}

:root[data-theme="dark"] .stat-item .count {
    background: rgba(255,255,255,0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fejléc stílusok */
header {
    text-align: left;
    padding: 1.5rem 2rem;
    background: var(--header-gradient);
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-left {
    flex: 0 0 30%;  /* Fix 30% szélesség */
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.header-title img {
    height: 120px;
    width: auto;
}

.header-title h1 {
    font-size: 3.5rem;
    margin-bottom: 0;
    font-weight: 800;
    letter-spacing: -1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-stats {
    text-align: left;
    padding: 1rem 1.5rem;
    background: rgba(15, 20, 60, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 200px;
}

.header-right {
    flex: 0 0 65%;  /* Fix 65% szélesség */
}

/* Reszponzív módosítások a headerhez */
@media (max-width: 768px) {
    header {
        padding: 0.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 0.5rem;
    }

    .header-left {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-title {
        text-align: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .header-title h1 {
        font-size: 2.5rem;
    }

    .header-controls {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .header-stats {
        margin: 0;
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .header-right {
        display: none;
    }
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    background-color: var(--card-background);
    color: var(--secondary-color);
    box-shadow: 0 -2px 4px var(--shadow-color);
}

/* Animációk */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Kategória szűrők */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    justify-content: center;
    background-color: var(--card-background);
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    opacity: 0.9;
}

.filter-btn.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor;
}

/* Kategória színek - magasabb specificitással */
.category-filters .filter-btn[data-category="all"] {
    background: #000000 !important;  /* Fekete */
}

.category-filters .filter-btn[data-category="math"] {
    background: #1abc9c !important;  /* Türkiz */
}

.category-filters .filter-btn[data-category="history"] {
    background: #e74c3c !important;  /* Élénk piros */
}

.category-filters .filter-btn[data-category="language"] {
    background: #3498db !important;  /* Élénk kék */
}

.category-filters .filter-btn[data-category="art"] {
    background: #9b59b6 !important;  /* Lila */
}

.category-filters .filter-btn[data-category="programming"] {
    background: #34495e !important;  /* Sötét szürke */
}

.category-filters .filter-btn[data-category="literature"] {
    background: #f1c40f !important;  /* Arany sárga */
}

.category-filters .filter-btn[data-category="music"] {
    background: #e67e22 !important;  /* Narancs */
}

/* A kategória címkék ugyanazokat a színeket használják */
.category-tag[data-category="math"] {
    background: #1abc9c !important;
}

.category-tag[data-category="history"] {
    background: #e74c3c !important;
}

.category-tag[data-category="language"] {
    background: #3498db !important;
}

.category-tag[data-category="art"] {
    background: #9b59b6 !important;
}

.category-tag[data-category="programming"] {
    background: #34495e !important;
}

.category-tag[data-category="literature"] {
    background: #f1c40f !important;
}

.category-tag[data-category="music"] {
    background: #e67e22 !important;
}

/* Játék kártyák */
.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-background);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
    border-color: rgba(0, 0, 0, 0.15);
}

.game-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.category-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.new-game-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.game-card-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.game-card-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.game-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.difficulty {
    color: #f1c40f;
}

.star {
    margin-right: 2px;
}

.play-btn {
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.play-btn:hover {
    background-color: #c0392b;
}

.arrow-icon {
    font-size: 24px;
    color: #2ecc71;
    margin-left: auto;
    transition: transform 0.2s ease-in-out;
}

.game-card:hover .arrow-icon {
    transform: translateX(5px);
}

/* Játékszabályok szekció */
.rules-section {
    background-color: var(--card-background);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.rules-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.rules-section ul {
    list-style-position: inside;
}

.rules-section li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Reszponzív módosítások */
@media (max-width: 768px) {
    .category-filters {
        padding: 1rem;
    }
    
    .game-card-image {
        height: 150px;
    }
    
    .game-card-content {
        padding: 1rem;
    }
    
    .rules-section {
        padding: 1.5rem;
        margin: 1rem 0;
    }
}

.header-stats h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    text-align: center;
}

#total-games {
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    min-width: 35px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    margin-left: 0.5rem;
}

.stats-carousel {
    height: 2rem;
    position: relative;
    overflow: hidden;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.9rem;
    position: absolute;
    width: 100%;
    left: 0;
    opacity: 0;
    transform: translateY(100%);
    transition: none;
    visibility: hidden;
}

.stat-item.next {
    transform: translateY(100%);
    opacity: 0;
    visibility: visible;
    transition: none;
}

.stat-item.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stat-item.prev {
    transform: translateY(-100%);
    opacity: 0;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stat-item .category-name {
    color: rgba(255,255,255,0.9);
}

.stat-item .count {
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    min-width: 35px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Kiemelt játék stílusok */
.featured-game {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.5rem;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 20px;
    background: #4776E6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.featured-content {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.featured-content:hover {
    transform: translateY(-5px);
}

.featured-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-content:hover .featured-image img {
    transform: scale(1.05);
}

.featured-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.8) 40%,
        rgba(0, 0, 0, 0.4) 80%,
        rgba(0, 0, 0, 0) 100%);
    color: white;
}

.featured-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.featured-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.featured-meta span {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    color: white;
    backdrop-filter: blur(5px);
}

.featured-meta .difficulty {
    color: #f1c40f;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.featured-info .play-btn {
    display: none;
}

/* Reszponzív módosítások a kiemelt játékhoz */
@media (max-width: 1024px) {
    .header-left {
        flex: 0 0 35%;
    }
    
    .header-right {
        flex: 0 0 60%;
    }

    .featured-info h2 {
        font-size: 1.8rem;
    }

    .featured-info p {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .header-left,
    .header-right {
        flex: 1 0 100%;
    }

    .featured-game {
        display: none;
    }
}

/* Sötét téma stílusok */
html[data-theme="dark"] body .header-stats {
    background: rgba(15, 20, 60, 0.95) !important;
}

[data-theme="dark"] .header-stats {
    background: rgba(15, 20, 60, 0.95) !important;
}

[data-theme="dark"] .stats-item {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .stats-value {
    background: rgba(255, 255, 255, 0.1);
} 