/* Osnovni stil */
:root {
    --primary-color: #6C63FF;
    /* Moderna vijolična */
    --secondary-color: #2ecc71;
    /* Zelena za akcije */
    --background-color: #1a1a2e;
    /* Temno ozadje */
    --card-background: #16213e;
    /* Nekoliko svetlejše ozadje za kartice */
    --text-color: #e0e0e0;
    --input-background: #0f3460;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

header {
    background-color: var(--card-background);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

/* Obrazci */
.form-container {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #a0a0a0;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: var(--input-background);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    width: 100%;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.game-card {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.game-card:hover {
    transform: translateY(-3px);
}

.game-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.game-info {
    padding: 1rem;
}

.game-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.game-meta {
    font-size: 0.85rem;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: white;
    font-weight: 500;
    line-height: 1;
}

.badge-category {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(108, 99, 255, 0.3);
}

.badge-mechanic {
    background-color: #34495e;
    /* Different color for mechanics to distinguish from categories */
    border: 1px solid #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- NOVI STILI --- */

/* 1. Header & Navigacija */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.hamburger-btn {
    background: transparent;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    width: auto !important;
    /* Override global button width */
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.hamburger-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* 2. Sidebar Meni */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: var(--card-background);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 2500;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2400;
    display: none;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    padding: 0 1.5rem 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-menu-item {
    padding: 1rem 1.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background: var(--input-background);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* 3. Hero Sekcija */
.hero-section {
    background: linear-gradient(135deg, var(--card-background) 0%, var(--input-background) 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.next-session-date {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin: 1rem 0;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

/* 4. Leaderboard */
.leaderboard-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table th {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.rank-1 {
    color: #f1c40f;
    font-weight: bold;
}

.rank-2 {
    color: #bdc3c7;
    font-weight: bold;
}

.rank-3 {
    color: #d35400;
    font-weight: bold;
}

/* 5. Admin & Modals */
.admin-controls {
    display: none;
    /* JS will toggle flex */
    gap: 0.5rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly darker overlay */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    /* Aligns to top, safe for scrolling */
    padding: 0;
    /* JS event listeners toggle flex */
    overflow-y: auto;
    /* Enable scrolling on the overlay */
}

.modal-content {
    width: 90%;
    max-width: 500px;
    position: relative;
    /* Use margin to center vertically if space allows, otherwise just spacing */
    margin: 2rem auto;
    animation: slideDown 0.3s ease-out;
    /* Ensure content background is set if form-container class logic relies on it */
    background: var(--card-background);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1rem;
    color: #888;
    cursor: pointer;
    background: none;
    border: none;
    width: auto !important;
    padding: 0;
}

.close-modal:hover {
    color: white;
}

/* --- 6. Multi-Select Custom Component (Chips) --- */
.multi-select-container {
    width: 100%;
}

.custom-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* Razmik med čipi */
    margin-top: 8px;
}

.custom-chip {
    background: transparent;
    border: 1px solid #555;
    border-radius: 4px;
    /* Bolj kvadratni kot prej, kot tagi */
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-chip:hover {
    border-color: #888;
    background: rgba(255, 255, 255, 0.05);
}

/* Selected States */
.custom-chip.selected {
    color: white;
    font-weight: 600;
    border-color: transparent;
}

.custom-chip.category.selected {
    background-color: var(--primary-color);
    /* Modra */
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.3);
}

.custom-chip.mechanic.selected {
    background-color: var(--secondary-color);
    /* Zelena */
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

/* Voting Card Info Button & Overlay */
#active-game-card {
    position: relative;
    overflow: hidden;
}

.vote-info-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.vote-info-btn:hover {
    background: rgba(108, 99, 255, 0.8);
    transform: scale(1.1);
}

.vote-description-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vote-description-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.vote-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.vote-overlay-close:hover {
    color: white;
}

.vote-overlay-text {
    color: #e2e8f0;
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 500;
}

/* Winner Display Info Button & Overlay */
.winner-info-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.winner-info-btn:hover {
    background: rgba(108, 99, 255, 0.8);
    transform: scale(1.1);
}

.winner-description-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.winner-description-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.winner-overlay-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.4rem;
    transition: color 0.2s;
}

.winner-overlay-close:hover {
    color: white;
}

.winner-overlay-text {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Calendar Icon Visibility */
.cancel-calendar-icon::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5);
    cursor: pointer;
}
