:root {
    --calcio-primary: #0107A3;
    --calcio-secondary: #FF5733;
    --volley-primary: #3DD907;
    --volley-secondary: #33C1FF;
    --background: #f5f5f5;
    --text: #333;
    --white: #ffffff;
    --gray-light: #f8f8f8;
    --gray-medium: #e0e0e0;
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --gradient-blue: linear-gradient(135deg, #0107A3, #1a26ff);
    --gradient-green: linear-gradient(135deg, #3DD907, #6fff33);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section & Header */
.hero {
    background-color: var(--background);
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.logo-container {
    margin: 0 auto 20px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.logo-placeholder i {
    font-size: 50px;
    color: var(--calcio-primary);
}

.volley .logo-placeholder i {
    color: var(--volley-primary);
}

.main-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--white);
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow);
}

.main-nav a.calcio {
    background: var(--gradient-blue);
}

.main-nav a.volley {
    background: var(--gradient-green);
}

.main-nav a:hover, .main-nav a.active {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Sub Navigation */
.sub-nav {
    background: var(--white);
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.sub-nav a {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    border-radius: 20px;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.sub-nav a:hover {
    background: var(--gray-light);
}

.sub-nav a.active {
    background: var(--calcio-primary);
    color: var(--white);
}

.volley .sub-nav a.active {
    background: var(--volley-primary);
}

/* Content Sections */
.content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.section-divider {
    height: 4px;
    width: 80px;
    background: var(--calcio-primary);
    margin: 10px auto;
    border-radius: 2px;
}

.volley-table .section-divider,
.volley .section-divider {
    background: var(--volley-primary);
}

.standings-section, .matches-section {
    margin-bottom: 50px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.modern-table th {
    background: var(--calcio-primary);
    color: var(--white);
    font-weight: 600;
    padding: 15px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.result-column {
    min-width: 60px;
    text-align: center;
}

.modern-table td {
    padding: 15px;
    border-bottom: 1px solid var(--gray-medium);
    font-size: 1rem;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:nth-child(even) {
    background-color: var(--gray-light);
}

.modern-table tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.volley-table th {
    background-color: var(--volley-primary);
}

.no-data {
    text-align: center;
    font-style: italic;
    color: #888;
    padding: 30px !important;
}

/* Stili per gli stati delle partite */
.match-canceled {
    background-color: rgba(255, 200, 200, 0.3) !important;
}

.match-canceled:hover {
    background-color: rgba(255, 200, 200, 0.5) !important;
}

.match-suspended {
    background-color: rgba(255, 240, 180, 0.3) !important;
}

.match-suspended:hover {
    background-color: rgba(255, 240, 180, 0.5) !important;
}

/* Footer */
.footer {
    background: #2c2c2c;
    color: var(--white);
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

.footer p {
    font-size: 0.9rem;
}

.admin-link {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.admin-link:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Download Button Styles */
.download-section {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0 20px;
}

.download-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--calcio-primary) !important;
    color: white !important;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    min-height: 44px;
    min-width: 200px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.volley .download-btn {
    background: var(--volley-primary);
}

.download-btn:hover {
    background: #000a8a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: white;
}

.volley .download-btn:hover {
    background: #32c505;
}

/* Hover and active states with correct colors */
.download-btn:hover,
.download-btn:active {
    background-color: #000a8a !important; /* Darker blue for calcio hover */
    color: white !important;
    text-decoration: none !important;
}

.volley .download-btn:hover,
.volley .download-btn:active {
    background-color: #32c505 !important; /* Darker green for volley hover */
    color: white !important;
    text-decoration: none !important;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.download-btn:hover::before {
    left: 100%;
}

.download-icon {
    font-size: 16px;
    margin-right: 4px;
}

.download-text {
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

/* Fallback styles for download button in case of CSS variable issues */
a.download-btn {
    display: inline-flex !important;
    background-color: #0107A3 !important; /* Fallback calcio color */
    color: #ffffff !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    -webkit-text-decoration: none !important;
    -moz-text-decoration: none !important;
}

.volley a.download-btn {
    background-color: #3DD907 !important; /* Fallback volley color */
}

/* Force button appearance on all devices */
.download-btn:link,
.download-btn:visited,
.download-btn:hover,
.download-btn:active {
    color: white !important;
    text-decoration: none !important;
}

/* Specific background colors for each sport */
.download-btn:link,
.download-btn:visited {
    background-color: #0107A3 !important; /* Calcio blue */
}

.volley .download-btn:link,
.volley .download-btn:visited {
    background-color: #3DD907 !important; /* Volley green */
}

@media (max-width: 768px) {
    .hero {
        padding: 20px 15px;
    }
    
    .logo-container {
        width: 120px;
        height: 120px;
        margin-bottom: 15px;
    }
    
    .main-title {
        display: none;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .main-nav a {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .standings-section, .matches-section {
        padding: 15px;
    }
    
    .modern-table th, .modern-table td {
        padding: 10px;
    }
    
    .result-column {
        min-width: 60px;
    }
    
    .pagination-controls {
        gap: 10px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }    .download-btn {
        display: inline-flex !important;
        padding: 14px 20px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 280px !important;
        justify-content: center !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        border-radius: 8px !important;
        background: #0107A3 !important; /* Fallback per calcio */
        color: white !important;
        text-decoration: none !important;
        min-height: 48px !important;
        align-items: center !important;
        gap: 10px !important;
        font-weight: 700 !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
    }
    
    .volley .download-btn {
        background: #3DD907 !important; /* Fallback specifico per volley */
    }
      .download-section {
        margin: 25px 0 20px 0 !important;
        padding: 0 15px !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .download-icon {
        font-size: 18px !important;
        display: inline-block !important;
    }
    
    .download-text {
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        display: inline-block !important;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 15px 10px;
    }
    
    .logo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }
    
    .logo-placeholder i {
        font-size: 30px;
    }
    
    .main-title {
        display: none;
    }
    
    .download-btn {
        padding: 16px 24px;
        font-size: 15px;
        width: 100%;
        max-width: none;
        margin: 0 auto;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        border-radius: 10px;
        font-weight: 700;
    }
    
    .download-section {
        margin: 30px 0 25px 0;
        padding: 0 20px;
    }
    
    .download-icon {
        font-size: 20px;
        margin-right: 6px;
    }
    
    .download-text {
        font-size: 15px;
        letter-spacing: 0.8px;
    }
    
    /* Aggiungi un leggero effetto pulsante per mobile */
    .download-btn:active {
        transform: translateY(1px) scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

@media (min-width: 1200px) {
    .logo-container {
        width: 110px;
        height: 110px;
    }
}

/* Form Styles */
.form-container {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    margin-bottom: 15px;
    resize: vertical;
}

button {
    background-color: var(--calcio-primary);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.volley-button {
    background-color: var(--volley-primary);
}

/* Message Styles */
.message {
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav a {
    text-decoration: none;
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav a.calcio {
    background-color: var(--calcio-primary);
}

.nav a.volley {
    background-color: var(--volley-primary);
}

.nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Paginazione */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 10px 0;
}

.pagination-btn {
    background: var(--calcio-primary);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.pagination-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.volley-table + .pagination-controls .pagination-btn {
    background: var(--volley-primary);
}

#pageInfo {
    font-size: 0.9rem;
    color: var(--text);
}