/* ============================================
   igricezadecu.rs - Modern Design System 2026
   ============================================ */

/* === CSS Variables / Theme === */
:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --accent-alt: #FDCB6E;
    --bg-dark: #1A1A2E;
    --bg-card: #16213E;
    --bg-surface: #0F3460;
    --bg-body: #F8F9FD;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --text-white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-glow: 0 0 20px rgba(108,92,231,0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;
    --navbar-height: 64px;
    --container-max: 1280px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p { font-size: 1rem; color: var(--text-secondary); }

/* === Layout === */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.section { padding: 3rem 0; }
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: all var(--transition);
}
.navbar.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: var(--shadow-lg);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    text-decoration: none;
    white-space: nowrap;
}
.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.navbar-brand:hover { color: var(--primary-light); }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}
.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}
.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-white);
    background: rgba(108,92,231,0.15);
}

/* Search in Navbar */
.navbar-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 0 0.25rem 0 1rem;
    transition: all var(--transition);
    border: 1px solid transparent;
}
.navbar-search:focus-within {
    background: rgba(255,255,255,0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.2);
}
.navbar-search input {
    background: none;
    border: none;
    color: var(--text-white);
    padding: 0.5rem 0;
    font-size: 0.875rem;
    width: 180px;
    outline: none;
}
.navbar-search input::placeholder { color: rgba(255,255,255,0.4); }
.navbar-search button {
    padding: 0.4rem 0.75rem;
    color: var(--text-white);
    background: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition);
}
.navbar-search button:hover { background: var(--primary-dark); }

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
}
.navbar-toggle:hover { background: rgba(255,255,255,0.1); }

/* Language Switcher */
.lang-switcher {
    position: relative;
}
.lang-current {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all var(--transition);
    cursor: pointer;
    background: none;
}
.lang-current:hover { border-color: var(--primary); color: var(--text-white); }
.lang-flag { font-size: 1.1rem; line-height: 1; }
.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 0.375rem;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    z-index: 1001;
}
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: block; }
.lang-dropdown li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.lang-dropdown li a:hover { background: rgba(108,92,231,0.2); color: var(--text-white); }
.lang-dropdown li.active a { color: var(--primary-light); font-weight: 600; }

/* === Hero Section (Homepage) === */
.hero {
    padding-top: calc(var(--navbar-height) + 2rem);
    padding-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-surface) 50%, var(--bg-card) 100%);
    color: var(--text-white);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(108,92,231,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(0,206,201,0.1) 0%, transparent 40%);
    animation: heroFloat 20s ease-in-out infinite;
    pointer-events: none;
}
@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, 2%); }
}
.hero h1 {
    color: var(--text-white);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
    position: relative;
}
.hero h1 .gradient-text {
    background: linear-gradient(90deg, var(--accent-alt), var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* === Game Grid === */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.game-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    text-decoration: none;
    display: block;
}
.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.game-card:hover .game-card-img img {
    transform: scale(1.05);
}
.game-card-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}
.game-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.game-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108,92,231,0.7);
    opacity: 0;
    transition: opacity var(--transition);
}
.game-card:hover .game-card-play { opacity: 1; }
.game-card-play svg {
    width: 48px;
    height: 48px;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.game-card-info {
    padding: 0.625rem 0.75rem;
}
.game-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card .trophy-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(253,203,110,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* === Category Cards === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.category-card img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-bottom: 0.5rem;
}
.category-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* === Game Page === */
.game-page {
    padding-top: calc(var(--navbar-height) + 1rem);
}
.game-player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-width: 900px;
    margin: 0 auto 1.5rem;
}
#fullscreen-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
}
#fullscreen-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Splash Screen */
#splashScreen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-surface));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
#playButton {
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
}
#playButton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(108,92,231,0.5);
}

/* Fullscreen/Exit buttons */
.game-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem 0;
}
.btn-game-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-white);
    background: var(--primary);
    border-radius: 50px;
    transition: all var(--transition);
}
.btn-game-control:hover { background: var(--primary-dark); }

#exitFullscreenButton {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255,0,0,0.85);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: all var(--transition);
}
#exitFullscreenButton:hover { background: #ff0000; transform: scale(1.1); }

/* Game Info Sections */
.game-info-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.game-info-section h2,
.game-info-section h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Comments Section */
.comments-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.comment-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child { border-bottom: none; }
.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 2px solid #eee;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color var(--transition);
}
.comment-form textarea:focus { border-color: var(--primary); outline: none; }
.comment-form button {
    margin-top: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition);
}
.comment-form button:hover { background: var(--primary-dark); }

/* Category Badges */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    margin: 0.25rem;
    transition: all var(--transition);
}
.category-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    padding: 2rem 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108,92,231,0.05);
}
.pagination a.active, .pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === Footer === */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}
.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}
.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .separator { color: var(--text-light); }

/* === SEO Content Block === */
.seo-content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}
.seo-content h2 { margin-bottom: 1rem; }
.seo-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}
.seo-content p:last-child { margin-bottom: 0; }

/* === Login/Register Forms === */
.auth-section {
    padding-top: calc(var(--navbar-height) + 2rem);
    min-height: 80vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.auth-card-header {
    background: linear-gradient(135deg, var(--primary), var(--bg-surface));
    color: var(--text-white);
    padding: 2rem;
    text-align: center;
}
.auth-card-header h2 { color: var(--text-white); font-size: 1.5rem; }
.auth-card-body { padding: 2rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 2px solid #eee;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
    font-family: var(--font-main);
}
.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
}
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* === Responsive === */
@media (max-width: 1024px) {
    .navbar-nav { display: none; }
    .navbar-toggle { display: flex; }
    .navbar-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: var(--bg-dark);
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        box-shadow: var(--shadow-lg);
    }
    .navbar-nav.open a { padding: 0.75rem 1rem; }
    .navbar-search { order: -1; width: 100%; }
    .navbar-search input { width: 100%; }
}

@media (max-width: 768px) {
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
    .categories-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
    .section { padding: 2rem 0; }
    .hero { padding-top: calc(var(--navbar-height) + 1rem); padding-bottom: 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .game-info-section { padding: 1rem; }
    .seo-content { padding: 1.25rem; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .category-card { padding: 0.75rem 0.25rem; }
    .category-card img { width: 56px; height: 56px; }
    .category-card span { font-size: 0.75rem; }
}

/* === Utility === */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* === Smooth page load === */
body { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === Print === */
@media print {
    .navbar, .footer, .game-controls, .lang-switcher, .navbar-search { display: none !important; }
    body { background: #fff; }
}
