/**
 * SNELLIX - Game Theme
 * 
 * Design gamificato ispirato a giochi mobile
 * - Sfondo scenografico
 * - Menu bottom con icone 3D
 * - Bottoni grandi e colorati
 * - Card semi-trasparenti
 * 
 * @author SNELLIX Team
 * @date 2025-11-14
 */

:root {
    /* Colori principali */
    --primary-blue: #6b75d7;
    --primary-green: #4CAF50;
    --primary-orange: #FF9800;
    --primary-red: #F44336;
    --primary-purple: #9C27B0;
    
    /* Colori UI */
    --bg-sky: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    --bg-grass: linear-gradient(180deg, #7CB342 0%, #558B2F 100%);
    --bg-overlay: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-dark: rgba(0, 0, 0, 0.7);
    
    /* Ombre e effetti */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.25);
    --shadow-button: 0 6px 0 rgba(0, 0, 0, 0.2);
    
    /* Bordi */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Spaziature */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

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

body {
    font-family: 'Oswald', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: url('/assets/images/backgrounds/leather.jpg') center center / cover no-repeat fixed;
    display: flex;
    flex-direction: column;
}

/* Dark mode background */
body.dark-skin {
    background: url('/assets/images/backgrounds/carbon.jpg') center center / cover no-repeat fixed;
}

/* Tipografia impattante e giocosa */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Font Ageer per TUTTI i bottoni */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-add,
.btn-generate,
.btn-replace,
.btn-alternatives,
.btn-icon-delete,
.game-button,
.chat-action-button,
[class*="btn-"],
input[type="submit"],
input[type="button"] {
    font-family: 'Oswald', 'Oswald', sans-serif !important;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

strong, b {
    font-weight: 700;
}

/* Mobile Frame - RIMOSSO (non più utilizzato)
#mobile-frame {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#mobile-frame #app-container {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    max-height: 932px;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 40px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 768px) {
    #mobile-frame {
        background: transparent;
    }
    
    #mobile-frame #app-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

body > #app-container {
    width: 100%;
    height: 100vh;
}
*/

/* Container principale con sfondo */
#app-container {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sfondo scenografico - RIMOSSO, usiamo body background */
/* .game-background non più necessario, sfondo gestito da body con leather/carbon */

/* Decorazioni sfondo disabilitate - uso immagine dashboard.webp */
/*
.game-background::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: var(--bg-grass);
    clip-path: polygon(0 30%, 100% 20%, 100% 100%, 0 100%);
}

.bg-clouds {
    position: absolute;
    top: 10%;
    left: 0;
    width: 100%;
    height: 200px;
    background: 
        radial-gradient(ellipse 150px 60px at 20% 50%, rgba(255,255,255,0.8) 0%, transparent 100%),
        radial-gradient(ellipse 200px 80px at 60% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(ellipse 180px 70px at 85% 60%, rgba(255,255,255,0.7) 0%, transparent 100%);
    animation: floatClouds 60s linear infinite;
}

@keyframes floatClouds {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}
*/

/* Content area */
.game-content {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-lg);
    padding-bottom: 48px; /* Extra spazio in fondo */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling su iOS */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-content .page-container {
    width: 100%;
    max-width: 100%;
}

/* Scrollbar personalizzata per content */
.game-content::-webkit-scrollbar {
    width: 8px;
}

.game-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.game-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.game-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Header top */
.game-header {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* Dark mode header */
body.dark-skin .game-header {
    background: linear-gradient(135deg, #92ff0d 0%, #75cc0a 100%);
    box-shadow: 0 2px 10px rgba(146, 255, 13, 0.3);
}

/* Dark mode header text color */
body.dark-skin .game-header h2 {
    color: #000 !important;
}

/* Logo SNELLIX scritta - colorazione via CSS */
.header-logo-text {
    height: 22px;
    width: auto;
    filter: brightness(0) invert(1); /* Rende bianco un PNG nero */
    transition: filter 0.3s ease;
}

.header-logo-text:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

/* Dark mode logo - nero su lime */
body.dark-skin .header-logo-text {
    filter: brightness(0); /* Rende nero */
}

body.dark-skin .header-logo-text:hover {
    filter: brightness(0) drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

/* Logo SNELLIX icon - mantiene colori originali */
.snellix-logo {
    height: 40px;
    width: auto;
}

/* Logo generale per altri usi - colorabile via CSS */
.logo-colored {
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(228deg) brightness(100%) contrast(119%);
    /* Colore viola #667eea */
}

.header-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    border: 3px solid #FFD700;
    box-shadow: var(--shadow-md);
}

.user-coins {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
}

.settings-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.settings-icon:hover {
    transform: scale(1.1);
}

/* Card stile gioco */
.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

/* Bottoni stile gioco */
.game-button {
    display: block;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-sm) 0;
    font-family: 'Oswald', 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(180deg, #6b75d7 0%, #5a63c4 100%);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 
        var(--shadow-button),
        inset 0 2px 0 rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
    overflow: hidden;
}

.game-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.game-button:hover::before {
    left: 100%;
}

.game-button:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255,255,255,0.3);
}

/* Varianti bottoni */
.game-button.green {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
}

.game-button.orange {
    background: linear-gradient(180deg, #FF9800 0%, #F57C00 100%);
}

.game-button.red {
    background: linear-gradient(180deg, #F44336 0%, #D32F2F 100%);
}

.game-button.purple {
    background: linear-gradient(180deg, #9C27B0 0%, #7B1FA2 100%);
}

/* Bottom Navigation Menu */
.bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 100;
    flex-shrink: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.95) 0%, rgba(124, 58, 237, 0.98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(139, 92, 246, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Dark mode bottom nav */
body.dark-skin .bottom-nav {
    background: linear-gradient(180deg, rgba(146, 255, 13, 0.95) 0%, rgba(117, 204, 10, 0.98) 100%);
    box-shadow: 0 -2px 10px rgba(146, 255, 13, 0.3);
}

/* Icone menu */
.nav-icon {
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-icon:active {
    transform: scale(0.95);
}

/* Icona container 3D */
.icon-3d {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #3498db, #2980b9);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 
        0 6px 0 rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    position: relative;
}

.nav-icon:hover .icon-3d {
    transform: translateY(-4px);
    box-shadow: 
        0 10px 0 rgba(0, 0, 0, 0.2),
        0 12px 25px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.nav-icon:active .icon-3d {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 rgba(0, 0, 0, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* Icona centrale (Chat) - Più grande */
.nav-icon.center {
    width: 80px;
    height: 80px;
}

.nav-icon.center .icon-3d {
    width: 75px;
    height: 75px;
    font-size: 2.5rem;
    background: linear-gradient(145deg, #4CAF50, #388E3C);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 6px 0 rgba(0, 0, 0, 0.2),
            0 8px 20px rgba(0, 0, 0, 0.3),
            0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 
            0 6px 0 rgba(0, 0, 0, 0.2),
            0 8px 20px rgba(0, 0, 0, 0.3),
            0 0 0 10px rgba(76, 175, 80, 0);
    }
}

/* Colori icone */
.nav-icon.home .icon-3d {
    background: linear-gradient(145deg, #FF9800, #F57C00);
}

.nav-icon.stats .icon-3d {
    background: linear-gradient(145deg, #E91E63, #C2185B);
}

.nav-icon.food .icon-3d {
    background: linear-gradient(145deg, #9C27B0, #7B1FA2);
}

.nav-icon.profile .icon-3d {
    background: linear-gradient(145deg, #00BCD4, #0097A7);
}

/* Badge notifiche */
.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #F44336;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

/* Input stile gioco */
.game-input {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 3px solid rgba(107, 117, 215, 0.3);
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.game-input:focus {
    outline: none;
    border-color: #6b75d7;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 4px rgba(107, 117, 215, 0.2);
}

/* Animazioni */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Responsive */
@media (max-width: 768px) {
    .game-content {
        padding: var(--spacing-md);
    }
    
    .nav-icon {
        width: 60px;
        height: 60px;
    }
    
    .icon-3d {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .nav-icon.center .icon-3d {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }
}

/* Scrollbar personalizzata */
.game-content::-webkit-scrollbar {
    width: 8px;
}

.game-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.game-content::-webkit-scrollbar-thumb {
    background: rgba(107, 117, 215, 0.5);
    border-radius: 4px;
}

.game-content::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 117, 215, 0.7);
}
