/* Esplush.lol - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Main Colors */
    --primary: #FF914D;
    --primary-hover: #ff7a2e;
    --primary-light: rgba(255, 145, 77, 0.1);
    
    /* Light Theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --header-bg: rgba(255, 255, 255, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2d2d2d;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(15, 15, 15, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.7);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
    transition: all 0.3s ease;
}

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

.logo {
    flex-shrink: 0;
}

.logo img {
    height: 36px;
    width: auto;
    transition: transform 0.2s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* Search Bar */
.search-container {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
}

.theme-toggle svg,
.theme-toggle i {
    width: 20px;
    height: 20px;
}

/* Show moon in light mode, sun in dark mode */
.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }
[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-icon-dark { display: none; }

/* Pin Button on Game Cards */
.game-card-pin {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

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

.game-card-pin svg,
.game-card-pin i {
    width: 16px;
    height: 16px;
    color: #fff;
}

.game-card-pin.pinned {
    opacity: 1;
    background: var(--primary);
}

.game-card-pin:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Pinned badge */
.pinned-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding-top: 80px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Categories */
.categories-section {
    margin-bottom: 32px;
}

.categories-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.categories-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1;
    mask-image: linear-gradient(to right, transparent, black 0%, black 100%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 0%, black 100%, transparent);
}

.categories-wrapper.show-left .categories-scroll {
    mask-image: linear-gradient(to right, transparent, black 40px, black 100%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black 100%, transparent);
}

.categories-wrapper.show-right .categories-scroll {
    mask-image: linear-gradient(to right, transparent, black 0%, black calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 0%, black calc(100% - 40px), transparent);
}

.categories-wrapper.show-left.show-right .categories-scroll {
    mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent);
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.categories-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.categories-arrow:hover {
    background: var(--primary);
    color: #fff;
}

.categories-arrow i {
    width: 20px;
    height: 20px;
}

.categories-arrow-left {
    left: -18px;
}

.categories-arrow-right {
    right: -18px;
}

.categories-wrapper.show-left .categories-arrow-left {
    opacity: 1;
    visibility: visible;
}

.categories-wrapper.show-right .categories-arrow-right {
    opacity: 1;
    visibility: visible;
}

.category-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* Games Grid */
.games-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* Game Card */
.game-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

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

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

.game-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    transition: opacity 0.3s ease;
}

.game-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-category {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

/* Play Button on Hover */
.game-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.game-card:hover .game-card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.game-card-play svg {
    width: 24px;
    height: 24px;
    color: #fff;
    fill: #fff;
}

.game-card-play i {
    width: 28px;
    height: 28px;
    color: #fff;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-submit {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px 24px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-logo img {
    height: 28px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-copyright {
    font-size: 13px;
    color: var(--text-muted);
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border: none;
    transition: all 0.2s ease;
}

.language-selector:hover {
    background: var(--border-color);
}

/* ==================== LOADING ==================== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 16px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== NO RESULTS ==================== */
.no-results {
    text-align: center;
    padding: 60px 24px;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--text-muted);
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-secondary);
}

/* ==================== TOAST/NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== LEGAL PAGES ==================== */
.legal-page {
    padding-top: 100px;
    padding-bottom: 60px;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.legal-content .last-updated {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.legal-content h2 {
    font-size: 20px;
    margin: 32px 0 16px;
    color: var(--primary);
}

.legal-content p,
.legal-content li {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
    margin-left: 24px;
}

.legal-content a {
    color: var(--primary);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
        height: 60px;
    }
    
    .header-container {
        gap: 12px;
    }
    
    .logo img {
        height: 32px;
    }
    
    .search-container {
        max-width: none;
        order: 3;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        display: none;
    }
    
    .search-container.active {
        display: block;
    }
    
    .search-toggle {
        display: flex;
    }
    
    .btn-add-game span {
        display: none;
    }
    
    .btn-add-game {
        width: 42px;
        padding: 0;
    }
    
    .main-content {
        padding-top: 80px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-card {
        border-radius: 12px;
    }
    
    .category-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
