/* ============================
   LA MIA COLLEZIONE DI VIDEOGIOCHI
   site.css
   ============================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Premium Dark Theme */
    --bg:        #050507;
    --surface:   #0f0f13;
    --surface2:  #181820;
    --border:    #262633;
    --text:      #f4f4f8;
    --muted:     #8a8a9e;
    
    /* Neon Accents */
    --accent:    #6366f1;
    --accent-h:  #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    /* Status Colors */
    --green:     #10b981;
    --green-bg:  rgba(16, 185, 129, 0.15);
    --yellow:    #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.15);
    --blue:      #3b82f6;
    --blue-bg:   rgba(59, 130, 246, 0.15);
    --red:       #ef4444;
    --red-bg:    rgba(239, 68, 68, 0.15);
    
    /* Variables */
    --radius:    14px;
    --shadow:    0 8px 30px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
}

/* ---- NAVBAR ---- */
.navbar {
    background: rgba(15, 15, 19, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.brand-icon { 
    font-size: 1.5rem; 
    filter: drop-shadow(0 0 10px var(--accent-glow));
}
.nav-links { display: flex; gap: 8px; }
.nav-link {
    padding: 7px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link-cta {
    background: var(--accent);
    color: #fff !important;
}
.nav-link-cta:hover { background: var(--accent-h); }

/* ---- MAIN ---- */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
    width: 100%;
}

/* ---- ALERTS ---- */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.3); color: var(--green); }
.alert-warning { background: rgba(250,204,21,0.12); border: 1px solid rgba(250,204,21,0.3); color: var(--yellow); }
.alert-error   { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }

/* ---- PAGE HEADER ---- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.8rem; font-weight: 700; }
.page-subtitle { color: var(--muted); margin-top: 4px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.btn-primary  { 
    background: linear-gradient(135deg, var(--accent), var(--accent-h));
    color: #fff; 
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(99, 102, 241, 0.05); }
.btn-ghost    { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--border); background: var(--surface2); }
.btn-danger   { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-sm  { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- FILTER BAR ---- */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-input, .filter-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}
.filter-input { flex: 1; min-width: 180px; }
.filter-input:focus, .filter-select:focus { 
    border-color: var(--accent); 
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.filter-select option { background: var(--surface); }

/* ---- GAMES GRID ---- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* ---- GAME CARD ---- */
.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-h);
    box-shadow: var(--shadow-glow);
}
.game-cover {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--surface2);
    overflow: hidden;
}
.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    color: var(--border);
}
.score-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}
.score-high { background: rgba(74,222,128,0.85); color: #052e16; }
.score-mid  { background: rgba(250,204,21,0.85); color: #1a1200; }
.score-low  { background: rgba(248,113,113,0.85); color: #1a0000; }

.game-info { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.game-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.platform-tag, .genre-tag, .year-tag, .status-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.platform-tag { background: rgba(99,102,241,0.2); color: var(--accent-h); }
.genre-tag    { background: var(--surface2); color: var(--muted); }
.year-tag     { background: var(--surface2); color: var(--muted); }

/* Status tags */
.status-tag { border: 1px solid transparent; }
.status-dagiocare { background: var(--surface2); color: var(--text); border-color: var(--border); }
.status-incorso   { background: var(--blue-bg); color: var(--blue); border-color: rgba(59, 130, 246, 0.3); }
.status-completato{ background: var(--green-bg); color: var(--green); border-color: rgba(16, 185, 129, 0.3); }
.status-abbandonato{ background: var(--red-bg); color: var(--red); border-color: rgba(239, 68, 68, 0.3); }

.game-notes {
    font-size: 0.82rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.game-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.add-form { margin-top: auto; }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: 8px; }
.empty-state p  { color: var(--muted); margin-bottom: 28px; }
.empty-actions  { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- SEARCH PAGE ---- */
.search-hero {
    background: linear-gradient(135deg, rgba(124,106,245,0.15), rgba(124,106,245,0.05));
    border: 1px solid rgba(124,106,245,0.2);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
}
.search-form-large {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
}
.search-input-large {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 18px;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
.search-input-large:focus { border-color: var(--accent); }
.search-results-header { margin-bottom: 20px; color: var(--muted); }

/* ---- SEARCH TIPS ---- */
.search-tips { margin-top: 48px; text-align: center; }
.search-tips h2 { margin-bottom: 28px; font-size: 1.3rem; }
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}
.tip-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
}
.tip-icon { font-size: 2rem; margin-bottom: 12px; }
.tip-card h3 { margin-bottom: 8px; }
.tip-card p { color: var(--muted); font-size: 0.88rem; }

/* ---- FORM PAGE ---- */
.form-page { max-width: 680px; margin: 0 auto; }
.form-header { margin-bottom: 28px; }
.form-header h1 { font-size: 1.6rem; }
.back-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-control {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; }
select.form-control option { background: var(--surface2); }
.field-error { color: var(--red); font-size: 0.82rem; }

.form-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

.edit-cover-preview {
    width: 100%;
    max-height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 24px;
}
.edit-cover-preview img { width: 100%; object-fit: cover; }

/* ---- FOOTER ---- */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}
.footer a { color: var(--accent); text-decoration: none; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .nav-brand span:last-child { display: none; }
    .page-header { flex-direction: column; }
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .form-row { grid-template-columns: 1fr; }
    .search-form-large { flex-direction: column; }
    .form-card { padding: 20px; }
    .filter-bar { gap: 8px; }
}

/* ---- PAGINATION ---- */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
}
.page-btn-active {
    cursor: default;
    pointer-events: none;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-container {
    width: 100%;
    max-width: 420px;
}
.login-brand {
    text-align: center;
    margin-bottom: 36px;
}
.login-brand-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(124,106,245,0.6));
}
.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.login-brand p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 4px;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
}
.login-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 0.82rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.login-register {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}
.login-register a {
    color: var(--accent-h);
    text-decoration: none;
    font-weight: 600;
}
.login-register a:hover { text-decoration: underline; }
.input-group {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}
.input-group .form-control {
    padding-left: 42px;
    padding-right: 42px;
}
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
}
.password-toggle:hover { color: var(--text); }
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.form-label-row label { font-weight: 600; font-size: 0.9rem; }
.form-label-row a {
    font-size: 0.82rem;
    color: var(--accent-h);
    text-decoration: none;
}
.form-label-row a:hover { text-decoration: underline; }
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--muted);
    cursor: pointer;
}
.remember-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
