/* ==========================================================================
   TORNEKOEMAN PUBLIC STYLE SHEET - Versione Semplificata
   ========================================================================== */

/* === BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    position: relative;
    padding-top: 0 !important; /* Rimuove padding per header fisso */
    display: flex;
    flex-direction: column;
}

/* === UTILITY CLASSES === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }

/* === BUTTON STYLES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* === MAIN CONTENT === */
main {
    padding: 20px 0;
    min-height: calc(100vh - 180px);
    flex: 1;
    width: 100%;
}

/* === FOOTER STYLES IMPROVED FOR MOBILE/TABLET === */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px 0 15px;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.footer-section {
    text-align: center;
}

.footer-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.footer-section p {
    margin-bottom: 8px;
    opacity: 0.9;
    font-size: 0.9em;
    line-height: 1.4;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-section a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
    font-size: 0.85em;
}

.footer-bottom p {
    margin-bottom: 5px;
    line-height: 1.4;
}

.footer-bottom a {
    color: white;
    text-decoration: underline;
    opacity: 0.9;
}

.footer-bottom a:hover {
    opacity: 1;
}

/* Social icons in footer */
.footer-section .social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.footer-section .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.footer-section .social-icons a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* === RESPONSIVE FOOTER === */
@media (max-width: 768px) {
    .footer {
        padding: 15px 0 10px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .footer-section {
        text-align: center;
        padding: 0 5px;
    }
    
    .footer-section h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .footer-section p {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    
    .footer-bottom {
        font-size: 0.8em;
        padding-top: 10px;
    }
    
    .footer-bottom p {
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .footer-section {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 12px;
    }
    
    .footer-section:last-child {
        border-bottom: none;
    }
    
    .footer-section h3 {
        font-size: 0.95em;
    }
    
    .footer-section p {
        font-size: 0.8em;
    }
    
    .footer-bottom {
        font-size: 0.75em;
    }
}

/* === FORM STYLES === */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* === CARD STYLES === */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.card-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.card-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    color: #555;
    line-height: 1.6;
}

/* === TABLES === */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: none;
}

table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table td {
    padding: 15px;
    text-align: left;
    vertical-align: middle;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

/* === ALERTS === */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.badge-success {
    background: #2ecc71;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-info {
    background: #3498db;
    color: white;
}

/* === PAGE HEADER === */
.page-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 15px 15px;
}

.page-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: white;
}

.page-header p {
    font-size: 1.1em;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .card {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .card-title {
        color: #ffffff;
    }
    
    .table-striped tbody tr:nth-child(odd) {
        background: #2d2d2d;
    }
    
    input, select, textarea {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #404040;
    }
    
    .footer {
        background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    }
}

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* === PRINT STYLES === */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .btn {
        display: none !important;
    }
    
    .footer {
        display: none !important;
    }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .btn {
        width: 100% !important;
        max-width: 300px !important;
        padding: 12px 20px !important;
        font-size: 15px !important;
        margin: 10px auto !important;
        display: block !important;
    }
    
    .card {
        padding: 20px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px 5px;
    }
    
    .page-header {
        padding: 30px 0;
        margin-bottom: 30px;
    }
    
    .page-header h1 {
        font-size: 2em;
    }
    
    .page-header p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 15px;
    }
    
    .card-title {
        font-size: 1.3em;
    }
    
    .footer {
        padding: 10px 0 8px;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    input, select, textarea {
        font-size: 16px;
    }
    
    .footer-section a {
        padding: 5px 0;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */
.header {
    will-change: transform;
    contain: layout style;
}

img {
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

body {
    font-display: swap;
}

.logo-img {
    aspect-ratio: 1 / 1;
}

@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px !important;
    }
    
    .mobile-horizontal-menu a,
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-reduced-data: reduce) {
    .hero-banner {
        background-image: linear-gradient(135deg, #2c3e50 0%, #3498db 100%) !important;
    }
    
    img:not([src*="logo"]) {
        display: none;
    }
}

/* === MENU STYLES (Nuovo sistema) === */
.mobile-nav-container,
.menu-overlay,
.mobile-nav-menu,
.mobile-menu-toggle,
.tablet-horizontal-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* IL MENU DESKTOP NON DEVE ESSERE NASCOSTO QUI */
/* .nav-desktop ul rimane gestito dal CSS in header.php */

/* Stili per il menu mobile orizzontale */
.mobile-horizontal-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
    margin-top: 15px;
}

.mobile-horizontal-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 140px;
    flex: 1 1 calc(25% - 16px);
    max-width: calc(25% - 16px);
    transition: all 0.3s;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.mobile-horizontal-menu a:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.mobile-horizontal-menu a.active {
    background: #e74c3c;
    border-color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.mobile-horizontal-menu a i {
    font-size: 0.95em;
    min-width: 18px;
}

/* Stili per il menu desktop */
.nav-desktop {
    display: none;
}

@media (min-width: 1025px) {
    .nav-desktop {
        display: flex;
    }
    
    .nav-desktop ul {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 10px;
    }
    
    .nav-desktop a {
        color: white;
        text-decoration: none;
        padding: 12px 18px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.95em;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        background: rgba(255,255,255,0.1);
    }
    
    .nav-desktop a:hover {
        background: rgba(255,255,255,0.2);
        transform: translateY(-2px);
    }
    
    .nav-desktop a.active {
        background: #e74c3c;
        border: 1px solid rgba(255,255,255,0.3);
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
    }
    
    .mobile-horizontal-menu {
        display: none;
    }
}

/* === HEADER STYLES === */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    position: relative;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 15px 0;
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    margin-bottom: 15px;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.logo-img {
    height: 55px;
    width: auto;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-main-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.logo-subtitle {
    margin: 5px 0 0 0;
    font-size: 1em;
    color: #ecf0f1;
    font-weight: 600;
}

.logo-slogan {
    margin: 3px 0 0 0;
    font-size: 0.85em;
    color: #f1c40f;
    font-weight: 600;
    font-style: italic;
}

/* LIVE badge */
.torneo-live-badge {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
}

/* === RESPONSIVE HEADER === */
@media (min-width: 1025px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 25px;
        min-height: 80px;
    }
    
    .logo-container {
        width: auto;
        margin-bottom: 0;
        justify-content: flex-start;
    }
    
    .logo-img {
        height: 60px;
    }
    
    .logo-text {
        margin-left: 15px;
    }
    
    .logo-main-title {
        font-size: 1.3em;
    }
    
    .logo-subtitle {
        font-size: 1.05em;
    }
    
    .logo-slogan {
        font-size: 0.9em;
    }
    
    .mobile-horizontal-menu {
        display: none;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .header-container {
        padding: 0 20px;
    }
    
    .logo-img {
        height: 60px;
    }
    
    .logo-main-title {
        font-size: 1.25em;
    }
    
    .mobile-horizontal-menu a {
        min-width: 150px;
        font-size: 0.95em;
        padding: 14px 18px;
        flex: 1 1 calc(25% - 16px);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 0;
    }
    
    .header-container {
        padding: 0 15px;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-img {
        height: 50px;
    }
    
    .logo-text {
        align-items: center;
    }
    
    .logo-main-title {
        font-size: 1.1em;
        text-align: center;
    }
    
    .logo-subtitle {
        font-size: 0.95em;
        text-align: center;
    }
    
    .logo-slogan {
        font-size: 0.8em;
        text-align: center;
    }
    
    .mobile-horizontal-menu a {
        min-width: 130px;
        font-size: 0.85em;
        padding: 10px 14px;
        flex: 1 1 calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 0;
    }
    
    .header-container {
        padding: 0 10px;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .logo-main-title {
        font-size: 1em;
    }
    
    .logo-subtitle {
        font-size: 0.9em;
    }
    
    .logo-slogan {
        font-size: 0.75em;
    }
    
    .mobile-horizontal-menu {
        gap: 6px;
    }
    
    .mobile-horizontal-menu a {
        min-width: 110px;
        font-size: 0.8em;
        padding: 8px 12px;
        flex: 1 1 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

/* Landscape mode special adjustments */
@media (max-width: 1024px) and (orientation: landscape) {
    .header-container {
        padding: 8px 15px;
    }
    
    .logo-container {
        flex-direction: row;
        gap: 10px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .logo-text {
        align-items: flex-start;
    }
    
    .mobile-horizontal-menu a {
        min-width: 120px;
        font-size: 0.8em;
        padding: 8px 12px;
        flex: 1 1 calc(25% - 12px);
        max-width: calc(25% - 12px);
    }
}

/* === HERO SECTION STYLES === */
.hero-banner {
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.7)), url('../assets/images/basket-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.3em;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* === GRID LAYOUTS === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.5s ease forwards;
}

.slide-in-down {
    animation: slideInDown 0.5s ease forwards;
}

/* === LOADING STATES === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === BACK TO TOP BUTTON === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
    z-index: 999;
    opacity: 0.9;
    outline: none;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* === NOTIFICATION STYLES === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-success {
    background: #2ecc71;
    color: white;
}

.notification-error {
    background: #e74c3c;
    color: white;
}

.notification-info {
    background: #3498db;
    color: white;
}

.notification-warning {
    background: #f39c12;
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === FORM VALIDATION STYLES === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-error {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

.form-control.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* === MODAL STYLES === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.modal-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.modal-close:hover {
    color: #e74c3c;
}

/* === TAB STYLES === */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab:hover {
    color: #3498db;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* === STATISTICS STYLES === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.page-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.page-link.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === ACCORDION === */
.accordion {
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    width: 100%;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header i {
    transition: transform 0.3s;
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-content.active {
    padding: 20px;
    max-height: 1000px;
}

/* === TOOLTIP === */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #2c3e50;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* === PROGRESS BAR === */
.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* === RESPONSIVE TABLES === */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 60px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-state-description {
    max-width: 400px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* === SEARCH BOX === */
.search-box {
    position: relative;
    margin: 20px 0;
}

.search-box input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #5a67d8;
}

/* === FILTERS === */
.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* === MEDIA QUERIES SPECIALI === */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5em;
    }
    
    .hero-subtitle {
        font-size: 1.1em;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2em;
    }
    
    .hero-subtitle {
        font-size: 1em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid #2c3e50;
    }
    
    .card {
        border: 2px solid #2c3e50;
    }
    
    .form-control,
    .form-select {
        border: 2px solid #2c3e50;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .card,
    .mobile-horizontal-menu a,
    .nav-desktop a,
    .back-to-top {
        transition: none;
    }
    
    .fade-in,
    .slide-in-up,
    .slide-in-down {
        animation: none;
        opacity: 1;
    }
}

/* === UTILITY CLASSES AGGIUNTIVE === */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.m-auto { margin: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-auto { margin-top: auto !important; margin-bottom: auto !important; }

.p-0 { padding: 0 !important; }
.p-10 { padding: 10px !important; }
.p-20 { padding: 20px !important; }

.rounded { border-radius: 8px !important; }
.rounded-circle { border-radius: 50% !important; }

.shadow { box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important; }
.shadow-lg { box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; }

.bg-white { background: white !important; }
.bg-light { background: #f8f9fa !important; }
.bg-primary { background: #667eea !important; }
.bg-success { background: #2ecc71 !important; }
.bg-danger { background: #e74c3c !important; }
.bg-warning { background: #f39c12 !important; }

.text-white { color: white !important; }
.text-primary { color: #667eea !important; }
.text-success { color: #2ecc71 !important; }
.text-danger { color: #e74c3c !important; }
.text-warning { color: #f39c12 !important; }
.text-muted { color: #666 !important; }

.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-normal { font-weight: 400 !important; }

.text-sm { font-size: 0.875em !important; }
.text-lg { font-size: 1.125em !important; }
.text-xl { font-size: 1.25em !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

.top-0 { top: 0 !important; }
.right-0 { right: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.left-0 { left: 0 !important; }

.z-1 { z-index: 1 !important; }
.z-10 { z-index: 10 !important; }
.z-100 { z-index: 100 !important; }
.z-1000 { z-index: 1000 !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }

.pointer { cursor: pointer !important; }
.not-allowed { cursor: not-allowed !important; }

.user-select-none { user-select: none !important; }

.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-100 { opacity: 1 !important; }

.transition { transition: all 0.3s ease !important; }

.transform-none { transform: none !important; }
.transform-scale-1 { transform: scale(1) !important; }
.transform-scale-105 { transform: scale(1.05) !important; }
.transform-translate-y-0 { transform: translateY(0) !important; }
.transform-translate-y-2 { transform: translateY(-2px) !important; }

/* === PRINT OPTIMIZATIONS === */
@media print {
    .header,
    .footer,
    .back-to-top,
    .mobile-horizontal-menu,
    .nav-desktop {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black !important;
        background: white !important;
    }
    
    .container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    a {
        color: black !important;
        text-decoration: none !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* === FINE FILE === */