

/* ========================================
   OTTIMIZZAZIONI MOBILE GLOBALI
   Applicate a tutte le pagine del sito
   ======================================== */

/* Base mobile optimizations */
@media (max-width: 768px) {
    /* Reset padding per tutto il contenuto */
    body, main, .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Immagini responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Videos responsive */
    video, iframe {
        max-width: 100%;
        height: auto;
    }
    
    /* Form elements */
    input, select, textarea, button {
        font-size: 16px !important; /* Evita zoom su iOS */
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Links e bottoni touch-friendly */
    a, button, .btn, input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Tables responsive */
    table {
        font-size: 14px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Cards su mobile */
    .card, .nb-card {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    /* Lists */
    ul, ol {
        padding-left: 1.5rem;
    }
    
    /* Headers */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    h4 { font-size: 1.25rem !important; }
    h5 { font-size: 1.125rem !important; }
    h6 { font-size: 1rem !important; }
    
    /* Paragraphs */
    p {
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* Spacing */
    .mb-1 { margin-bottom: 0.5rem !important; }
    .mb-2 { margin-bottom: 1rem !important; }
    .mb-3 { margin-bottom: 1.5rem !important; }
    .mt-1 { margin-top: 0.5rem !important; }
    .mt-2 { margin-top: 1rem !important; }
    .mt-3 { margin-top: 1.5rem !important; }
    .p-1 { padding: 0.5rem !important; }
    .p-2 { padding: 1rem !important; }
    .p-3 { padding: 1.5rem !important; }
}

/* Mobile: Colonna singola per tutte le grid */
@media (max-width: 768px) {
    .row, .grid, .grid-2, .grid-3, .grid-4,
    .columns, .col, .col-6, .col-4, .col-3,
    .flex-row, .flex-col {
        display: block !important;
    }
    
    .col, .col-6, .col-4, .col-3,
    .col-sm, .col-md, .col-lg,
    [class*="col-"] {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Flexbox columns */
    .flex-row > * {
        width: 100% !important;
        margin-bottom: 0.75rem;
    }
}

/* Mobile: Very small screens */
@media (max-width: 320px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.35rem !important; }
    h3 { font-size: 1.2rem !important; }
    
    .btn, button, input, select, textarea {
        font-size: 15px !important;
        padding: 10px 16px !important;
        min-height: 44px;
    }
    
    /* Riduci padding generale */
    .container, .wrapper, main {
        padding: 0.5rem !important;
    }
}

/* Prevent text selection issues on mobile */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    
    a, area, button, [role="button"], input[label], label {
        touch-action: manipulation;
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
}

/* Optimize font rendering on mobile */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* Mobile: Hide non-essential elements */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Neuralis BookMaker - Main Stylesheet */

/* ==================== */
/* CSS Variables        */
/* ==================== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a22;
    --bg-input: #252530;
    
    --accent: #00b8b8;
    --accent-light: #5fd4d4;
    --accent-dark: #008888;
    
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a8;
    --text-muted: #666;
    
    --border: #333;
    --border-light: #444;
    
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    
    --gradient-accent: linear-gradient(135deg, #00b8b8 0%, #5fd4d4 50%, #00b8b8 100%);
    
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-accent: 0 8px 24px rgba(0, 184, 184, 0.25);
}
main {
padding-top: 80px;
}

@media (max-width: 768px) {
main {
padding-top: 70px;
}
}
/* ==================== */
/* Reset & Base         */
/* ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== */
/* Background Pattern   */
/* ==================== */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 184, 184, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 184, 184, 0.05) 0%, transparent 50%),
        repeating-linear-gradient(0deg, transparent, transparent 100px, rgba(0, 184, 184, 0.02) 100px, rgba(0, 184, 184, 0.02) 101px),
        repeating-linear-gradient(90deg, transparent, transparent 100px, rgba(0, 184, 184, 0.02) 100px, rgba(0, 184, 184, 0.02) 101px);
    pointer-events: none;
    z-index: 0;
}

/* ==================== */
/* Header               */
/* ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.98), rgba(10, 10, 15, 0.9));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 184, 184, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 150px;
    width: auto;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text .accent {
    color: var(--accent);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent);
}

/* Credits Display in Header */
.credits-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 184, 184, 0.1);
    border: 1px solid rgba(0, 184, 184, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.credits-label {
    font-size: 1.2rem;
}

.credits-amount {
    color: var(--accent);
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.lang-selector {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.35rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover,
.lang-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    z-index: 1001;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav a {
    color: var(--text-primary);
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.mobile-lang-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* ==================== */
/* Buttons              */
/* ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-success {
    background: var(--success);
    color: var(--bg-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* ==================== */
/* Forms                */
/* ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-label .required {
    color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.35rem;
}

/* ==================== */
/* Cards                */
/* ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==================== */
/* Flash Messages       */
/* ==================== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
}

.flash-message button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2rem;
}

.flash-success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.flash-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
}

.flash-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== */
/* Footer               */
/* ==================== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(0, 184, 184, 0.1);
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo img {
    height: 35px;
}

.footer-logo span {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== */
/* Utilities            */
/* ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.text-accent {
    color: var(--accent);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== */
/* Responsive           */
/* ==================== */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
    
    .nav,
    .lang-selector {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Fix header for mobile */
    .logo img {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .credits-display {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .credits-label {
        font-size: 1rem;
    }
    
    .credits-amount {
        font-size: 0.9rem;
    }
    
    /* Fix mobile menu for mobile */
    .mobile-menu {
        padding: 1rem;
        top: 60px;
    }
    
    .mobile-nav a {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    
    .mobile-lang-selector {
        margin-top: 1rem;
    }
    
    /* Fix flash messages for mobile */
    .flash-messages {
        top: 70px;
        right: 10px;
        left: 10px;
    }
    
    .flash-message {
        padding: 0.75rem 1rem;
    }
    
    /* Fix footer for mobile */
    .footer {
        padding: 2rem 1rem;
    }
    
    .footer-logo img {
        height: 28px;
    }
    
    .footer-logo span {
        font-size: 0.9rem;
    }
    
    .footer-copy {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.6rem 0.8rem;
    }
    
    .logo-text {
        font-size: 0.95rem;
    }
    
    .credits-display {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .credits-label {
        font-size: 0.85rem;
    }
    
    .credits-amount {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 14px 20px;
        min-height: 44px;
        min-width: 44px;
        font-size: 16px;
    }
    
    .btn-lg {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .header-container {
        padding: 0.5rem 0.75rem;
    }
    
    .logo img {
        height: 35px;
    }
    
    .logo-text {
        font-size: 0.85rem;
    }
    
    .credits-display {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .credits-label {
        font-size: 0.8rem;
    }
    
    .credits-amount {
        font-size: 0.75rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .btn {
        width: 100%;
        padding: 12px 16px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
    
    .grid-2,
    .grid-3 {
        gap: 0.75rem;
    }
    
    .mobile-menu-toggle {
        height: 44px;
    }
    
    .mobile-nav a {
        padding: 0.75rem 0;
        font-size: 16px;
    }
    
    .mobile-lang-selector a {
        padding: 0.75rem 0;
        font-size: 16px;
    }
}
