/* RetroVault - Ancient Persian Theme */

:root {
    /* Sky blue palette */
    --sky-light: #e8f4f8;
    --sky-medium: #a8d4e6;
    --sky-deep: #5ba3c0;
    --sky-accent: #2d7a9c;

    /* Olive/Gold palette */
    --olive-light: #d4c896;
    --olive-medium: #a69f5c;
    --olive-dark: #6b6832;
    --gold: #c9a227;
    --gold-light: #e6c866;

    /* Earth tones */
    --sand: #f5e6c8;
    --sand-dark: #d4bc8a;
    --terracotta: #c45c3e;
    --burgundy: #722f37;

    /* Base colors */
    --bg-primary: #f0ead6;
    --bg-secondary: #e8e0c8;
    --bg-card: #faf6eb;
    --text-primary: #2c2416;
    --text-secondary: #5a4d3a;
    --text-muted: #8a7d6a;
    --border: #c4b896;
    --border-dark: #9a8b6a;
}

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

body {
    font-family: 'Segoe UI', 'Georgia', serif;
    background: var(--bg-primary);
    background-image:
        linear-gradient(to bottom, var(--sky-light) 0%, var(--bg-primary) 300px);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--sky-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--terracotta);
}

/* Persian Pattern Border */
.persian-border {
    border: 3px solid var(--olive-medium);
    border-image: repeating-linear-gradient(
        90deg,
        var(--gold) 0px,
        var(--gold) 10px,
        var(--sky-deep) 10px,
        var(--sky-deep) 20px,
        var(--olive-medium) 20px,
        var(--olive-medium) 30px
    ) 3;
}

/* Header */
.site-header {
    background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-accent) 100%);
    border-bottom: 4px solid var(--gold);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(45, 122, 156, 0.3);
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px,
        var(--gold) 20px,
        transparent 20px,
        transparent 25px
    );
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sand);
    font-size: 1.6rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.logo-text {
    font-family: 'Georgia', serif;
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--sand);
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    font-size: 1.05rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--gold-light);
}

.nav-link.active {
    color: var(--gold-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--gold);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--sand) 100%);
    border: 3px solid var(--olive-medium);
    border-radius: 8px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--gold);
    opacity: 0.5;
}

.hero::before {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.hero::after {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-family: 'Georgia', serif;
    color: var(--sky-accent);
    text-shadow: 2px 2px 0 var(--sand-dark);
    letter-spacing: 3px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-style: italic;
}

/* Decorative Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--olive-medium), transparent);
}

.divider-icon {
    margin: 0 1rem;
    color: var(--gold);
    font-size: 1.5rem;
}

/* Filters Section */
.filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(107, 104, 50, 0.1);
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    background: var(--sand);
    border: 2px solid var(--border);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--sky-deep);
    box-shadow: 0 0 0 3px rgba(91, 163, 192, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genre-btn {
    padding: 0.5rem 1.25rem;
    background: var(--sand);
    border: 2px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.genre-btn:hover {
    background: var(--sky-light);
    border-color: var(--sky-medium);
    color: var(--sky-accent);
}

.genre-btn.active {
    background: linear-gradient(135deg, var(--sky-deep) 0%, var(--sky-accent) 100%);
    border-color: var(--sky-accent);
    color: white;
    box-shadow: 0 2px 6px rgba(45, 122, 156, 0.3);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--olive-medium), var(--gold));
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(107, 104, 50, 0.2);
    border-color: var(--sky-deep);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--sand);
    border-bottom: 2px solid var(--border);
}

.game-card-content {
    padding: 1rem 1.25rem;
}

.game-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-family: 'Georgia', serif;
}

.game-card-year {
    font-size: 0.85rem;
    color: var(--olive-dark);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.game-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.game-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.genre-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--sky-light);
    border: 1px solid var(--sky-medium);
    border-radius: 12px;
    color: var(--sky-accent);
    text-transform: capitalize;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 3px solid var(--olive-medium);
    margin-top: 4rem;
    background: linear-gradient(0deg, var(--sand) 0%, var(--bg-primary) 100%);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px,
        var(--gold) 15px,
        transparent 15px,
        transparent 20px
    );
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sky-deep) 0%, var(--sky-accent) 100%);
    color: white;
    border-color: var(--sky-accent);
    box-shadow: 0 3px 8px rgba(45, 122, 156, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--sky-accent) 0%, var(--sky-deep) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 122, 156, 0.4);
}

.btn-secondary {
    background: var(--sand);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--olive-light);
    border-color: var(--olive-medium);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 36, 22, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border: 3px solid var(--olive-medium);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, var(--sky-light) 0%, var(--sand) 100%);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-family: 'Georgia', serif;
    color: var(--sky-accent);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--terracotta);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--sky-deep);
    border-radius: 50%;
    margin-left: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--sand);
}

::-webkit-scrollbar-thumb {
    background: var(--olive-medium);
    border-radius: 6px;
    border: 2px solid var(--sand);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--olive-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}
