/* --- FONTS & VARIABILI --- */
@font-face {
    font-family: 'SEGO';
    src: url('/asset/fonts/sego/SEGO.ttf') format('truetype'),
         url('/asset/fonts/sego/SEGO.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

.tenor-sans-regular {
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
}

:root {
    /* Pastel Color Scheme */
    --hero-primary: #B794F6;
    --hero-secondary: #FAF089;
    --hero-accent-pink: #FBB6CE;
    --hero-accent-blue: #90CDF4;
    --hero-accent-green: #9AE6B4;
    --hero-accent-orange: #FBD38D;
    --hero-bg-dark: #E9D8FD;
    --hero-bg-mid: #FED7E2;
    --hero-bg-light: #BEE3F8;
    
    /* Body gradient - pastel */
    --body-gradient: linear-gradient(135deg, #E9D8FD 0%, #FED7E2 50%, #BEE3F8 100%);
    
    /* Legacy Variables */
    --base-font: 20px;
    --muted: #6B7280;
    --accent: #6C63FF;
    --accent-2: #FF6B6B;
    --accent-glow: rgba(108, 99, 255, 0.5);
    --bg-dark: rgba(233, 216, 253, 0.95);
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1F2937;
    --text-muted: #4B5563;
    --text-light: #FFFFFF;
    --error: #EF4444;
    --success: #10B981;
    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #FF6B6B 100%);
    --gradient-glow: linear-gradient(135deg, rgba(108, 99, 255, 0.4) 0%, rgba(255, 107, 107, 0.4) 100%);
}

/* ============================= */
/*    TEXT BACKGROUND CLASSES     */
/* ============================= */

/* Semi-transparent dark background for text readability */
.text-bg, .content-box, .text-section {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Gradient text background */
.text-bg-gradient {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Light text background for dark sections */
.text-bg-light {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.1);
}

/* Section with hero colors */
.hero-section-content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Readable text wrapper - use this for any text that needs a background */
.readable-bg {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Semi-transparent overlay for images/videos */
.media-overlay {
    position: relative;
}

.media-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(15, 12, 41, 0.9), transparent);
    pointer-events: none;
}

/* Card with gradient border */
.gradient-border-card {
    position: relative;
    background: transparent;
    border-radius: 16px;
    padding: 2rem;
}

/* ============================= */
/*    CLOUD BACKGROUND CLASS     */
/* ============================= */

/* Effetto nuvola/glassmorphism per i testi */
.cloud-bg {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

/* Effetto nuvola chiaro */
.cloud-bg-light {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.1);
}

.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6c63ff, #ffdd57, #ff6b6b);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* --- RESET & LAYOUT BASE (FULL SCREEN) --- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: "Tenor Sans", sans-serif;
    background: #0D225B !important;
    background-attachment: fixed;
    color: #1F2937 !important;
    font-size: var(--base-font);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 100px;
}

main {
    flex: 1;
    width: 100%;
    padding-top: var(--header-height);
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 4rem;
    box-sizing: border-box;
}

/* But allow white text in hero sections with dark backgrounds */
.hero-section, .hero-background, .dark-section, [class*="hero-"], [class*="dark-"] {
    color: #fff !important;
}

.hero-section p, .hero-section span, .hero-section,
.hero-background p, .hero-background span, .hero-background li {
    color: rgba(255,255,255,0.9) !important;
}

/* Ensure all text is fully visible */
* {
    max-width: 100%;
}

p, span, li, td, th, label {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'SEGO', 'Segoe UI', system-ui, sans-serif;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 10px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Page transition overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

main {
    flex: 1;
    width: 100%;
    padding-top: var(--header-height);
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 2rem;
    box-sizing: border-box;
    overflow: visible;
    background: transparent;
}

.container, .page-section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 5%;
}

/* --- HEADER / NAVBAR --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: transparent;
    display: flex;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transition: all 0.4s ease;
}

header.scrolled {
    background-color: rgba(31, 17, 68, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    height: 80px;
    backdrop-filter: blur(10px);
}

header.hidden {
    transform: translateY(-110%);
}

/* Nav link hover effects */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-2);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-2);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- COMPONENTI & CARDS --- */
.card, .booking-section, #clientDashboard, #adminArea, .intro, .booking-form {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover, .booking-section:hover, #clientDashboard:hover, #adminArea:hover, .intro:hover, .booking-form:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
    border-color: rgba(108, 99, 255, 0.3);
}

.cards-grid, .dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

h2, h3 {
    font-family: 'SEGO', 'Segoe UI', system-ui, sans-serif;
    color: #1F2937;
    margin-bottom: 1.5rem;
    margin-left: 25px;
    position: relative;
    overflow: visible;
}

h2::before, h3::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 80%;
    background: var(--accent);
    border-radius: 3px;
}

/* --- FORM STYLES --- */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: var(--accent-2);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2), 0 0 20px rgba(108, 99, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

/* --- BUTTONS --- */
button, .btn-login, .btn-logout, .btn-dashboard, .calendar-link {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'SEGO', 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

button::before, .btn-login::before, .btn-logout::before, .btn-dashboard::before, .calendar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

button:hover::before, .btn-login:hover::before, .btn-logout:hover::before, .btn-dashboard:hover::before, .calendar-link:hover::before {
    left: 100%;
}

.primary, button.primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.primary:hover, button.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
    filter: brightness(1.1);
}

.secondary, button.secondary {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.secondary:hover, button.secondary:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

button:hover, .calendar-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* --- DASHBOARD SPECIFIC --- */
.dashboard-nav, .admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    padding: 1rem;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
}

.tab-btn:hover {
    color: var(--accent-2);
    background: rgba(255, 255, 255, 0.05);
}

/* --- FOOTER --- */
footer {
    background: #0D225B;
    color: #fff;
    padding: 3rem 5%;
    margin-top: auto;
    width: 100%;
    position: relative;
    overflow: visible;
    clear: both;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

footer .foot-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
    flex-wrap: wrap;
    text-align: center;
}

footer .brand-col {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

footer .brand-col h4 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 1rem;
}

footer .brand-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

footer .brand-col ul li {
    margin-bottom: 0.5rem;
}

footer a { color: var(--accent-2); text-decoration: none; transition: all 0.3s ease; }
footer a:hover { 
    text-decoration: underline; 
    text-shadow: 0 0 10px var(--accent-glow);
}

/* --- ANIMATIONS --- */
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { from {transform: rotate(0deg)} to {transform: rotate(360deg)} }

/* Pulse animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Fade in up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered fade in */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.visible {
    animation: fadeInUp 0.5s ease forwards;
}

/* Glow animation */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 30px var(--accent-glow); }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* --- CTA BOX --- */
.cta-box {
    background: linear-gradient(135deg, var(--accent), #5652d4);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.cta-box:hover::before {
    transform: rotate(45deg) translate(20%, 20%);
}

.cta-box:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(108, 99, 255, 0.4);
}

.cta-box h3 {
    color: white;
    margin-top: 0;
}

.cta-box a {
    display: inline-block;
    margin-top: 1rem;
    color: white;
}

/* DASHBOARD */
#clientDashboard, #adminArea {
    background: white;
    border-radius: 8px;
    padding: 2rem;
}

.dashboard-nav, .admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn, .admin-tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active, .admin-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content, .admin-tab-content {
    display: none;
}

.tab-content.active, .admin-tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.dashboard-card h4 {
    margin: 0 0 0.5rem;
    color: #1f1144;
}

.dashboard-card p {
    margin: 0;
    color: #666;
}

/* UPLOAD AREA */
.upload-area {
    background: #f9f9f9;
    border: 2px dashed var(--accent);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: #f0f7ff;
    border-color: #5652d4;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.2);
}

.upload-area p {
    margin: 0;
    color: #666;
}

/* BOOKING FORM */
.booking-form {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.booking-form button {
    margin-top: 1rem;
}

/* INTRO TEXT */
.intro {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin: 2rem 0;
}

.intro p {
    color: #666;
    line-height: 1.6;
}

/* --- LOADING STATES --- */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    /* Reduce base font sizes on mobile */
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    p {
        font-size: 0.9rem;
    }
    
    header {
        height: 80px;
    }
    
    main {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Footer mobile styles */
    footer {
        padding: 2rem 5%;
    }
    
    footer .foot-inner {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    footer .brand-col {
        min-width: 100%;
        padding: 0.5rem 0;
    }
    
    footer .brand-col h4 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    footer .brand-col ul li {
        font-size: 0.9rem;
    }
    
    /* Prevent text from being cut off */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix for cards and containers */
    .card, .booking-section, .intro, .content-card, .dashboard-card {
        overflow: hidden;
    }
    
    /* Ensure text doesn't overflow containers */
    p, span, h1, h2, h3, h4, h5, h6, li, td, th {
        max-width: 100%;
        overflow: visible;
    }
    
    /* Fix for text truncation */
    .truncate {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    /* Icon centering fix */
    .fas, .fab, .far, .fal, i[class*="fa-"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
    }
    
    /* Fix input text color */
    input, select, textarea {
        color: #333 !important;
    }
}

/* Global input text color fix - applies to all screen sizes */
input, select, textarea {
    color: #333 !important;
    background-color: #fff !important;
}

/* Button icon centering */
.btn i, .btn svg, button i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card:hover, .booking-section:hover, .intro:hover {
    transform: translateY(-3px);
}

button:hover, .btn-login:hover, .btn-logout:hover, .btn-dashboard:hover {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
