:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #457b9d;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #2a9d8f;
    --warning: #e9c46a;
    --danger: #e76f51;
    --purple: #9d4edd;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.2rem 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100" opacity="0.1"><path d="M20,20 L80,20 L80,80 L20,80 Z" fill="white" stroke="white" stroke-width="2"/></svg>');
    background-size: 50px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    padding: 0 1rem;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 1.5rem auto;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    position: relative;
}
.disclaimer {
    color: #b00000;                 /* text roșu */
    background-color: #fff0f0;      /* fundal roz pal */
    border-left: 5px solid #b00000;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.3rem;              /* text mai mare */
    font-weight: 500;
    line-height: 1.4;
    max-width: 900px;
    margin: 20px auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }

  .disclaimer p {
    margin: 8px 0 0;
  }
.page-description {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #555;
    font-size: 1rem;
    padding: 0 0.5rem;
}

.category {
    margin-bottom: 2rem;
}

.category-title {
    color: var(--primary);
    margin: 1rem 0 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.proba-section {
    margin-bottom: 2rem;
    background: var(--light);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.proba-title {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proba-title::before {
    content: "•";
    color: var(--primary);
    font-size: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    min-width: 600px;
}

th, td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.gender-header {
    background: var(--secondary);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

.score-cell {
    font-weight: 500;
}

.score-high {
    color: var(--success);
    font-weight: 600;
}

.score-medium {
    color: var(--warning);
}

.score-low {
    color: var(--danger);
}

.pdf-section {
    margin: 2rem 0;
    text-align: center;
}

.pdf-title {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.pdf-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.pdf-list a {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-size: 0.9rem;
}

.pdf-list a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(230, 57, 70, 0.2);
}

/* Secțiunea Popularitate */
.popularity-section {
    margin: 2.5rem 0;
}

.popularity-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.popularity-table {
    flex: 1 1 100%;
    max-width: 500px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    min-width: 280px;
    flex-shrink: 0;
}

.popularity-table table {
    min-width: 250px;
    width: 100%;
}

.popularity-header {
    padding: 0.8rem;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.popularity-boys {
    background: linear-gradient(135deg, var(--purple) 0%, #7b2cbf 100%);
}

.popularity-girls {
    background: linear-gradient(135deg, #FF6B6B 0%, #ee5a52 100%);
}

.popularity-table th {
    background: #f8f9fa;
    color: var(--dark);
    font-size: 0.85rem;
}

.popularity-table tr:first-child td {
    background: rgba(157, 78, 221, 0.05);
    font-weight: 600;
}

.popularity-table tr:nth-child(2) td {
    background: rgba(255, 107, 107, 0.05);
    font-weight: 600;
}

/* Stiluri pentru pozele din tabelele de popularitate */
.popularity-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px auto;
    display: block;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.popularity-image:hover {
    transform: scale(1.02);
}

/* Secțiunea Câștigători */
.winners-section {
    margin: 2.5rem 0;
    text-align: center;
}

.winners-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 2rem;
}

.winner-group {
    text-align: center;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}

.winner-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.winner-image:hover {
    transform: scale(1.05);
}

.winner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.winner-names {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.winner-position {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.winner-points {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.winner-points span {
    font-size: 0.9rem;
    color: var(--success);
    font-weight: 600;
}

.ranking-section {
    margin: 2.5rem 0;
}

.ranking-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.ranking-table {
    flex: 1 1 100%;
    max-width: 500px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    min-width: 280px;
    flex-shrink: 0;
}

.ranking-table table {
    min-width: 250px;
    width: 100%;
}

.ranking-header {
    padding: 0.8rem;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.boys-header {
    background: linear-gradient(135deg, #0074D9 0%, #0056b3 100%);
}

.girls-header {
    background: linear-gradient(135deg, #E84393 0%, #c2185b 100%);
}

.ranking-table th {
    background: #f8f9fa;
    color: var(--dark);
    font-size: 0.85rem;
}

.ranking-table tr:first-child {
    background: rgba(0, 116, 217, 0.05);
}

.ranking-table tr:nth-child(2) {
    background: rgba(232, 67, 147, 0.05);
}

/* Modal pentru zoom imagine */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 95%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    background: rgba(0,0,0,0.7);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Touch-friendly improvements */
.touch-optimized {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.touch-optimized:active {
    transform: scale(0.98);
}

/* Scroll indicator */
.scroll-hint {
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.scroll-indicator {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin: 10px 0;
    font-style: italic;
    width: 100%;
}

footer {
    text-align: center;
    padding: 1.2rem 0;
    color: #6c757d;
    margin-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

/* Mobile-first responsive adjustments */
@media (min-width: 768px) {
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 2rem;
        border-radius: 16px;
        margin: 2rem auto;
    }
    
    .category-title {
        font-size: 1.4rem;
    }
    
    .proba-section {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    th, td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .pdf-list a {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .popularity-table {
        flex: 1 1 450px;
    }
    
    .ranking-table {
        flex: 1 1 450px;
    }
    
    .winner-image {
        width: 250px;
        height: 250px;
    }
    
    .winner-names {
        font-size: 1.4rem;
    }
    
    .winner-points span {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .container {
        padding: 1rem;
        width: 98%;
    }
    
    .page-description {
        font-size: 0.9rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .proba-title {
        font-size: 1rem;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    
    .pdf-list {
        gap: 8px;
    }
    
    .pdf-list a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .winner-image {
        width: 180px;
        height: 180px;
    }
    
    .winner-names {
        font-size: 1.1rem;
    }
    
    .winner-points span {
        font-size: 0.85rem;
    }
    
    .ranking-table, .popularity-table {
        min-width: 260px;
    }
    
    .ranking-header, .popularity-header {
        font-size: 1rem;
        padding: 0.6rem;
    }
}

@media (max-width: 767px) {
    .scroll-hint {
        display: block;
    }
}