/* CSS di Caffè Di Stefano - Stile Premium ed Elegante */

/* Importazione Font da Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Reset e Variabili di Design */
:root {
    --primary: #d4af37; /* Oro di classe */
    --primary-hover: #e5c04f;
    --primary-glow: rgba(212, 175, 55, 0.35);
    
    --bg-dark: #0f0d0c; /* Nero Caffè molto scuro */
    --bg-card: rgba(28, 25, 23, 0.75); /* Pietra calda semitrasparente */
    --bg-input: rgba(41, 37, 36, 0.6);
    
    --text-light: #f5f5f4;
    --text-muted: #a8a29e;
    --border-color: rgba(212, 175, 55, 0.18);
    --border-glow: rgba(212, 175, 55, 0.3);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(rgba(15, 13, 12, 0.85), rgba(15, 13, 12, 0.93)), 
                url('../images/background.jpg') center/cover no-repeat fixed;
}

/* Stili Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #292524;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Header */
header {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 13, 12, 0.6);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    max-width: 800px;
    margin: 0 auto;
}

.brand-logo {
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto;
    transition: var(--transition);
}

.brand-logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.brand-title span {
    color: var(--primary);
    font-style: italic;
    font-weight: 400;
}

.brand-subtitle {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Contenitore Principale */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Sezione Info */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.08);
}

.info-card h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.info-card p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
}

.info-card .highlight {
    font-weight: 600;
    color: var(--text-light);
}

.contact-link {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.contact-link:hover {
    color: var(--primary);
    transform: translateX(3px);
}

/* Menu Grid Preview (per far sembrare il sito premium) */
.menu-preview-section {
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-light);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--primary);
    margin: 0.8rem auto 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.preview-item {
    background: rgba(28, 25, 23, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.preview-item:hover {
    background: rgba(28, 25, 23, 0.7);
    border-color: var(--border-color);
}

.preview-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.preview-item h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.preview-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Visualizzatore ed Azioni Menu */
.menu-display-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
}

.menu-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 10px var(--primary-glow)); }
}

.menu-display-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.menu-display-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Pulsanti */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background-color: var(--primary);
    color: #12100e;
    font-weight: 700;
    text-decoration: none;
    padding: 1.1rem 2.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: #12100e;
    box-shadow: 0 5px 20px var(--primary-glow);
}

/* PDF Viewer Frame con PDF.js */
#pdf-viewer-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pdf-toolbar {
    background: rgba(15, 13, 12, 0.9);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-tool {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tool:hover {
    background: var(--primary);
    color: #12100e;
    box-shadow: 0 0 10px var(--primary-glow);
}

.page-info {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
}

#page-num {
    color: var(--primary);
    font-weight: 700;
}

.pdf-interactive-container {
    position: relative;
    width: 100%;
}

.pdf-canvas-container {
    padding: 1.5rem;
    background: rgba(15, 13, 12, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
}

#pdf-canvas {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    background: white;
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Pulsanti Overlay di Navigazione Semitrasparenti */
.nav-overlay-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 13, 12, 0.45); /* Molto semitrasparente per far leggere il testo sottostante */
    border: 1.5px solid rgba(212, 175, 55, 0.7); /* Bordo oro sottile e semitrasparente */
    color: var(--primary); /* Freccia color oro */
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    backdrop-filter: blur(3px); /* Lieve sfocatura di sfondo per contrasto minimo senza nascondere */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.nav-overlay-btn:hover {
    background: rgba(212, 175, 55, 0.85); /* Sfondo oro all'hover per chiara azione di click */
    color: #0f0d0c; /* Testo scuro su sfondo oro al passaggio del mouse */
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-50%) scale(1.08); /* Ingrandimento leggermente più contenuto */
}

.nav-overlay-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.nav-overlay-btn.prev {
    left: 0.8rem; /* Spostati più vicini al bordo esterno per non coprire il testo */
}

.nav-overlay-btn.next {
    right: 0.8rem;
}

.nav-overlay-btn:disabled {
    opacity: 0.08; /* Quasi invisibile quando disabilitato, lasciando leggere il testo al 100% */
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    box-shadow: none;
    background: rgba(15, 13, 12, 0.1);
}

/* Adattamento pulsanti overlay per smartphone piccoli */
@media (max-width: 480px) {
    .nav-overlay-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .nav-overlay-btn.prev {
        left: 0.4rem; /* Attaccati al bordo schermo su mobile */
    }
    .nav-overlay-btn.next {
        right: 0.4rem;
    }
}

/* Stili Pseudo-Fullscreen per visualizzazione a schermo intero del menu */
#pdf-viewer-wrap.pseudo-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: var(--bg-dark) !important;
    display: flex !important;
    flex-direction: column !important;
}

#pdf-viewer-wrap.pseudo-fullscreen .pdf-toolbar {
    border-radius: 0 !important;
    background: rgba(10, 8, 7, 0.95) !important;
}

#pdf-viewer-wrap.pseudo-fullscreen .pdf-canvas-container {
    flex: 1 !important;
    max-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
    padding: 1rem;
    overflow-y: auto !important;
    background: #141210 !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

/* Area Admin - Login Card e Dashboard */
.admin-wrapper {
    max-width: 480px;
    margin: 4rem auto;
    width: 100%;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.admin-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    background: rgba(41, 37, 36, 0.8);
}

/* File Upload custom style */
.file-upload-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.file-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    background: rgba(15, 13, 12, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.03);
}

.file-upload-box i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.file-upload-box p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.file-upload-box .file-select-btn {
    margin-top: 1rem;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.selected-file-name {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
    display: none;
    word-break: break-all;
}

/* Notifiche ed Alert */
.alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Info del menu caricato in Dashboard */
.current-menu-info {
    background: rgba(15, 13, 12, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 2rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row .label {
    color: var(--text-muted);
}

.info-row .val {
    font-weight: 600;
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    font-weight: 500;
}

.btn-logout:hover {
    color: #ef4444;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 8, 7, 0.9);
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Responsive adjust */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2.2rem;
    }
    
    .container {
        padding: 2rem 1rem;
    }
    
    .menu-display-card {
        padding: 2rem 1.5rem;
    }
    
    .admin-card {
        padding: 2rem 1.5rem;
    }
}
