/* public/assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Outfit:wght@400;700;900&display=swap');

:root {
    /* Default Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-rgb: 59, 130, 246;
    --accent-hover: #60a5fa;
    --accent-gradient: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #2563eb;
    --accent-rgb: 37, 99, 235;
    --accent-hover: #1d4ed8;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.08);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar & Navigation */
.navbar { 
    height: 80px; 
    background: var(--bg-secondary); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--card-border); 
    width: 100%;
    z-index: 1000; 
    display: flex; 
    align-items: center;
    transition: var(--transition);
}

.navbar.sticky {
    position: fixed; 
    top: 0; left: 0; right: 0; 
}

.nav-container { 
    width: 100%;
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.nav-logo { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text-primary); }
.nav-logo img { height: 45px; width: auto; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; justify-content: center; }
.site-name { font-weight: 900; font-size: 1.4rem; line-height: 1; color: var(--text-primary); }
.site-tagline { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-top: 4px; }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.main-nav { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--text-primary); transition: color 0.3s; }
.main-nav a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 1.5rem; border-left: 1px solid var(--card-border); padding-left: 1.5rem; }
.btn-admin { color: var(--text-primary); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.btn-logout { color: var(--text-secondary); font-size: 1.1rem; }
.btn-login { background: var(--accent); color: white; padding: 0.6rem 1.5rem; border-radius: 10px; text-decoration: none; font-weight: 700; }

/* Mobile Menu Toggle */
.mobile-menu-toggle { display: none; background: transparent; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }

/* Mobile Nav Overlay */
.mobile-nav-overlay { 
    position: fixed; top: 0; right: -100%; width: 100%; height: 100%; 
    background: var(--bg-primary); z-index: 2000; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.mobile-nav-overlay.active { right: 0; }
.mobile-nav-header { padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--card-border); }
.mobile-menu-close { background: transparent; border: none; color: var(--text-primary); font-size: 1.8rem; cursor: pointer; }
.mobile-nav-content { padding: 2rem; flex: 1; overflow-y: auto; }
.mobile-nav-list { list-style: none; padding: 0; margin-bottom: 3rem; }
.mobile-nav-list li { margin-bottom: 1.5rem; }
.mobile-nav-list a { font-size: 1.8rem; font-weight: 800; text-decoration: none; color: var(--text-primary); }
.mobile-nav-actions { display: flex; flex-direction: column; gap: 1rem; }

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Spacing fixed above */

.event-detail-body h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: none;
    -webkit-text-fill-color: var(--text-primary);
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 2rem;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text-primary);
}

footer {
    text-align: left;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.role-redattore {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-utente {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

/* Form Sections */
.form-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.form-section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
}

/* Type Badges */
.type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-event {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.type-news {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.type-page {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.type-activity {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Status Badges */
.status-badge {
    font-size: 0.8rem;
    white-space: nowrap;
}

.status-draft { color: #fcd34d; }
.status-published { color: #86efac; }
.status-archived { color: var(--text-secondary); }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #16a34a;
    color: #15803d;
    font-weight: 600;
}

/* Event Detail Meta */
.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.event-meta-item i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* Event Body */
.event-body {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Event Contacts */
.event-contacts {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.event-contacts h3 {
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
}

/* Pagination & Sorting */
.pagination-public { display: flex; justify-content: center; gap: 0.75rem; margin: 3rem 0; }
.pagination-public a { 
    width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; 
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 50%; 
    color: white; text-decoration: none; font-weight: 600; transition: all 0.3s;
}
.pagination-public a.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 20px rgba(var(--accent-rgb),0.4); }
.pagination-public a:hover:not(.active) { transform: scale(1.1); border-color: var(--accent); }

.results-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; color: var(--text-secondary); font-size: 0.9rem; }
.results-sorting { display: flex; align-items: center; gap: 0.75rem; }
.results-sorting select { 
    background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); 
    color: var(--text-primary); padding: 0.4rem 0.75rem; border-radius: 8px; font-size: 0.85rem; outline: none; 
}

/* Date Blocks Management */
input, select, textarea {
    background: rgba(15, 23, 42, 0.1);
    color: inherit;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

.date-block {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.date-block:hover {
    border-color: var(--accent);
}

.date-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--card-border);
}

.date-block-num {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
}

.date-block-remove {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.date-block-remove:hover {
    background: #ef4444;
    color: white;
}

/* Footer Styles */
footer {
    padding: 6rem 0 0 0; /* Padding superiore e zero sotto */
    text-align: left;
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
}

.footer-container {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-columns {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links-list, .footer-links-inline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.footer-links-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links-list a:hover {
    color: var(--accent);
    padding-left: 5px;
}

/* Form Responsiveness Fixes */
.advanced-filter-card, .contact-form-advanced { 
    width: 100% !important; 
    max-width: 100% !important; 
    box-sizing: border-box !important; 
    overflow: visible !important;
}
.form-row { 
    display: grid !important; 
    grid-template-columns: 1fr 1fr; 
    gap: 1.5rem; 
    width: 100%; 
}
.form-group { width: 100%; }
.form-group input, .form-group select, .form-group textarea { 
    width: 100% !important; 
    box-sizing: border-box !important; 
}

@media (max-width: 992px) {
    .desktop-only { display: none !important; }
    .mobile-menu-toggle { display: block; }
    .navbar { height: 70px; }
    .nav-container { padding: 0 1.5rem; }
    .site-tagline { display: none; }
    
    .footer-columns { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .footer-col { align-items: center; display: flex; flex-direction: column; }
    .footer-links-list { align-items: center; }
}

@media (max-width: 768px) {
    .form-row, .search-bar-row { grid-template-columns: 1fr !important; flex-direction: column !important; align-items: stretch !important; gap: 1rem; }
    .search-bar-row select { width: 100% !important; }
    .search-events-form { padding: 1.5rem !important; }
    .hero { padding-top: 90px !important; min-height: 50vh !important; }
    .hero h1 { font-size: 2.2rem !important; }
    
    .nav-logo img { height: 35px; }
    .site-name { font-size: 1.2rem; }
    
    .results-grid.grid, .events-grid { grid-template-columns: 1fr !important; }
    .event-card-advanced, .result-card { max-width: 100%; }
    
    .results-toolbar { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

@media (max-width: 576px) {
    .footer-bottom-full .container { flex-direction: column; gap: 1rem; }
    .footer-minimal-links { flex-direction: column; gap: 0.75rem; align-items: center; }
}

/* Image Fluidity */
img { max-width: 100%; height: auto; }
video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

/* Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
}

/* Mobile Menu Enhancements */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--card-border);
}

.mobile-nav-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: center;
}

.mobile-nav-list li {
    margin-bottom: 2rem;
}

.mobile-nav-list a {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    display: block;
}

.mobile-nav-list a:hover {
    color: var(--accent);
    transform: scale(1.05);
}

.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

/* Dropdown Menu Styles */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-secondary);
    min-width: 200px;
    box-shadow: var(--shadow);
    z-index: 1001;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    top: 100%;
    overflow: hidden;
    right: 0;
    padding-top: 5px;
}

/* Pseudo-element to bridge the gap and keep hover active */
.dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
}
.dropdown-content a { color: var(--text-primary); padding: 12px 16px; text-decoration: none; display: block; font-size: 0.95rem; transition: var(--transition); }
.dropdown-content a:hover { background-color: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.dropdown:hover .dropdown-content { display: block; animation: fadeInDown 0.3s ease; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.event-detail-body {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem 1.5rem; /* Reduced bottom padding */
    position: relative; /* Anchor for absolute share bar */
}


/* Restored Global Rules from Hero Section */
body.has-sticky-menu main {
padding-top: 80px; /* Altezza della navbar fissa */
}

@media (max-width: 992px) {
body.has-sticky-menu main {
padding-top: 70px; /* Altezza ridotta su mobile */
}
}

main {
flex: 1;
}

.container {
max-width: var(--container-width, 1200px);
margin: 0 auto;
padding: 0 1.5rem;
}

/* Restored Global Rules from Front Extraction */
body.has-sticky-menu main { padding-top: 80px; }
@media (max-width: 992px) { body.has-sticky-menu main { padding-top: 70px; } }
.navbar-brand span { color: var(--accent); }
main { flex: 1; }
.container { max-width: var(--container-width, 1200px); margin: 0 auto; padding: 0 1.5rem; }
