/*
 * Colorino Web Admin Console - CSS Styling System
 * Design System: Modern Glassmorphic Dark Mode
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #0a0b10;
    --panel-bg: rgba(18, 20, 32, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --glow-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    --font-sans: 'Outfit', sans-serif;
}

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

body {
    background: radial-gradient(circle at 50% 0%, #1a1c30 0%, var(--bg-dark) 70%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Auth Pages Layout */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Glassmorphism Card style */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), var(--glow-shadow);
}

/* Heading Styling */
h1 {
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    margin-right: 8px;
    accent-color: var(--accent-purple);
    width: 16px;
    height: 16px;
}

/* Button Neumorfici */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font-sans);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 12px;
    color: var(--accent-pink);
    padding: 12px;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 24px;
    display: none;
}

/* Main Dashboard layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-logo span {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.sidebar-item.active a, .sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active a {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-left: 3px solid var(--accent-purple);
    padding-left: 13px;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--panel-border);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--accent-pink);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(236, 72, 153, 0.1);
}

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 40px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* KPI Cards Row */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.kpi-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.kpi-pink { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }
.kpi-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.kpi-orange { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

/* Graphs Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.chart-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-height: 380px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-canvas-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Responsive constraints */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 30px 10px;
    }
    .sidebar-logo span, .sidebar-item span, .user-info {
        display: none;
    }
    .sidebar-logo {
        padding-left: 0;
        justify-content: center;
    }
    .sidebar-item a {
        justify-content: center;
    }
    .main-content {
        margin-left: 80px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* SPA Tab Content Styles */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active-tab {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Modern Table Styles */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.custom-table th, .custom-table td {
    padding: 16px 20px;
    vertical-align: middle;
}
.custom-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}
.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Custom Slider & Range Styles */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}
.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}
.slider-value-bubble {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}
.custom-range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}
.custom-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-purple);
    transition: transform 0.1s ease;
}
.custom-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Theme Selection Cards */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 16px;
    margin-top: 15px;
    margin-bottom: 30px;
}
.theme-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.theme-card i {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}
.theme-card span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.theme-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}
.theme-card:hover i {
    transform: scale(1.15) rotate(5deg);
}
.theme-card.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    box-shadow: var(--glow-shadow);
}
.theme-card.selected span {
    color: var(--text-primary);
}
.theme-default i { color: var(--text-primary); }
.theme-summer i { color: #f59e0b; }
.theme-winter i { color: #38bdf8; }
.theme-christmas i { color: #ef4444; }
.theme-halloween i { color: #f97316; }

/* Modern Dynamic Save Button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    width: 100%;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4), var(--glow-shadow);
    filter: brightness(1.1);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Custom Toggle Switch for Game Visibility */
.toggle-switch-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.toggle-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}
.slider-toggle:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider-toggle {
    background-color: var(--accent-success);
}
input:focus + .slider-toggle {
    box-shadow: 0 0 1px var(--accent-success);
}
input:checked + .slider-toggle:before {
    transform: translateX(20px);
}/* Stili per il Drag and Drop dell'ordine dei giochi */
.toggle-row.dragging {
    opacity: 0.4;
    border: 1px dashed var(--accent-purple) !important;
    background: rgba(168, 85, 247, 0.1) !important;
}
.toggle-row.drag-over {
    border-top: 2px solid var(--accent-purple) !important;
    background: rgba(255, 255, 255, 0.05);
}
.drag-handle {
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}
.drag-handle:active {
    cursor: grabbing;
}
