/* Stile del body 
  Questo è caricato da index.html e imposta lo sfondo
*/
:root {
    --danger: #ef4444; /* Red-500 */
    --danger-rgb: 239, 68, 68;
    --primary: #991b1b; /* Red-800 */
    --primary-rgb: 153, 27, 27;
    --accent: #f59e0b; /* Amber-500 */
    
    /* Modern Flat Palette */
    --bg-body: #0f172a; /* Slate 950 */
    --bg-card: #1e293b; /* Slate 800 */
    --bg-item: #334155; /* Slate 700 */
    --bg-input: #020617; /* Slate 950 */
    --border-color: #334155; /* Slate 700 */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */

    /* MudBlazor Overrides to prevent white background */
    --mud-palette-background: var(--bg-body);
    --mud-palette-surface: var(--bg-card);
    --mud-palette-appbar-background: var(--bg-card);
    --mud-palette-text-primary: var(--text-main);
    --mud-palette-text-secondary: var(--text-muted);
}

body {
    /* Modern Flat Dark Background */
    background-color: var(--bg-body) !important;
    background-image: none !important;
    background-attachment: fixed;
    overscroll-behavior-y: none;
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Stili "Flat" Moderni (ex Glass) 
  Usati per card, bottoni, etc.
*/
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.glass-item {
    background: var(--bg-item);
    border: 1px solid var(--border-color);
    @apply rounded-xl shadow-sm transition-all duration-200;
}

.glass-item:hover {
    background: #475569; /* Slate 600 */
    border-color: #64748b; /* Slate 500 */
    transform: translateY(-2px);
}

/* Stili per input "flat" */
.glass-input, .glass-select, .glass-textarea {
    @apply w-full p-3 rounded-lg text-white placeholder-gray-500 border focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent transition-all duration-200;
    background-color: var(--bg-input);
    border-color: var(--border-color);
}

.glass-select option {
    color: #fff;
    background: var(--bg-card);
}

/* Stili per link nav interna (es. RH) */
.rh-nav-link {
    @apply flex flex-col justify-center items-center py-1.5 px-0.5 rounded-md text-slate-400 transition-all duration-200;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.rh-nav-link:hover {
    @apply bg-slate-800 text-slate-200;
}

.rh-nav-link:active {
    @apply scale-95;
}

.rh-nav-link.active {
    @apply bg-slate-800 text-white shadow-sm;
}

.rh-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.rh-nav-link svg {
    width: 1.125rem;
    height: 1.125rem;
    margin-bottom: 0.125rem;
    flex-shrink: 0;
    display: block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rh-nav-link.active svg {
    transform: translateY(-1px) scale(1.05);
    color: var(--accent);
}

.rh-nav-link span {
    @apply text-[10px] font-medium tracking-tight truncate;
    max-width: 100%;
}

/* Stili per i bottoni delle app nella home */
button, .glass-item {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Feedback visivo migliorato per tutti i bottoni interattivi */
button:active, 
.glass-item:active,
.cursor-pointer:active {
    transform: scale(0.96);
}

/* Animazione smooth per le transizioni */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Effetto tap/click temporaneo */
.tapped {
    transform: scale(0.95) !important;
    opacity: 0.9;
    transition: transform 0.1s ease, opacity 0.1s ease;
}

/* Nasconde la UI di errore di default di Blazor */
#blazor-error-ui {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

