/* ========================================
   MINULE ROCNIKY - SPECIFIC STYLES
   Requires shared.css to be loaded first
   ======================================== */

/* ========================================
   PAGE HERO
   Smaller version of the main hero
   ======================================== */

.page-hero {
    position: relative;
    padding-top: 140px;
    padding-bottom: 60px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(0, 61, 92, 0.4) 0%, transparent 70%);
}

.hero-content-wrapper h1 {
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #29abe2, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #b3e5fc;
    opacity: 0.8;
    animation: fadeInUp 1s ease;
}

/* ========================================
   YEAR SELECTOR
   ======================================== */

.year-selector-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    background: rgba(0, 61, 92, 0.3);
    padding: 15px 30px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(41, 171, 226, 0.2);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.selector-label {
    font-weight: bold;
    color: #b3e5fc;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.year-buttons {
    display: flex;
    gap: 10px;
}

.year-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.year-btn:hover:not(.disabled) {
    border-color: #29abe2;
    color: #29abe2;
    transform: translateY(-2px);
}

.year-btn.active {
    background: linear-gradient(135deg, #007bbf 0%, #29abe2 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(41, 171, 226, 0.3);
}

.year-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
}

/* ========================================
   RESULTS CONTENT
   ======================================== */

.results-container {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.results-container.active {
    display: block;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.meta-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #8faac2;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.meta-info span {
    background: rgba(10, 14, 39, 0.5);
    padding: 5px 15px;
    border-radius: 15px;
}

/* ========================================
   LEADERBOARD - TOP 3 CARDS
   ======================================== */

.leaderboard {
    max-width: 900px;
    margin: 0 auto;
}

.rank-card {
    display: flex;
    align-items: center;
    background: rgba(10, 14, 39, 0.6); /* Tmavší pozadí pro kontrast */
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

/* Medal Styles */
.rank-card.gold {
    border-left: 6px solid #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, rgba(10, 14, 39, 0.8) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.rank-card.silver {
    border-left: 6px solid #c0c0c0;
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.05) 0%, rgba(10, 14, 39, 0.8) 100%);
}

.rank-card.bronze {
    border-left: 6px solid #cd7f32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.05) 0%, rgba(10, 14, 39, 0.8) 100%);
}

.rank-badge {
    font-size: 2.5rem;
    font-weight: 900;
    width: 60px;
    text-align: center;
    margin-right: 20px;
    line-height: 1;
}

.gold .rank-badge { color: #ffd700; text-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
.silver .rank-badge { color: #e0e0e0; text-shadow: 0 0 15px rgba(192, 192, 192, 0.4); }
.bronze .rank-badge { color: #cd7f32; text-shadow: 0 0 15px rgba(205, 127, 50, 0.4); }

.team-details {
    flex: 1;
}

.team-details h3 {
    margin: 0 0 5px;
    font-size: 1.4rem;
    color: #fff;
}

.ship-name {
    color: #29abe2;
    font-size: 1rem;
    margin-bottom: 4px;
}

.crew {
    font-size: 0.9rem;
    color: #8faac2;
}

.result-time {
    text-align: center;
    padding-left: 25px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 100px;
}

.time-value {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.time-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 1px;
}

/* ========================================
   OTHER RANKS LIST
   ======================================== */

.other-ranks-list {
    margin-top: 40px;
    background: rgba(0, 61, 92, 0.2);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(41, 171, 226, 0.1);
}

.list-header {
    display: flex;
    justify-content: space-between;
    padding: 0 15px 15px;
    border-bottom: 1px solid rgba(41, 171, 226, 0.2);
    color: #b3e5fc;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.rank-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.rank-row:last-child {
    border-bottom: none;
}

.rank-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.rank-num {
    width: 50px;
    font-weight: bold;
    color: #8faac2;
    font-size: 1.1rem;
}

.row-content {
    flex: 1;
}

.row-content strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
}

.ship-small {
    color: #29abe2;
    font-size: 0.9rem;
    font-style: italic;
}

.row-time {
    font-weight: bold;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hero-content-wrapper h1 {
        font-size: 2.5rem;
    }

    .rank-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    .rank-card.gold, .rank-card.silver, .rank-card.bronze {
        border-left: none;
        border-top: 5px solid;
    }

    .rank-badge {
        margin: 0;
        width: auto;
    }

    .result-time {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 15px;
        padding-left: 0;
        width: 100%;
        margin-top: 5px;
    }

    .list-header {
        display: none; /* Hide header on mobile for simpler look */
    }

    .rank-row {
        flex-wrap: wrap;
        gap: 5px;
    }

    .rank-num {
        width: 30px;
    }
    
    .row-time {
        width: 100%;
        text-align: right;
        color: #8faac2;
        font-size: 0.9rem;
    }
}

/* --- ÚPRAVY PRO TLAČÍTKA A MODAL --- */

/* Kontejnery pro akci (nahrazuje result-time) */
.result-action {
    text-align: center;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.row-action {
    text-align: right;
    min-width: 80px;
}

/* Styl tlačítka FOTO */
.photo-btn {
    background: linear-gradient(135deg, rgba(41, 171, 226, 0.2) 0%, rgba(0, 123, 191, 0.2) 100%);
    border: 1px solid rgba(41, 171, 226, 0.5);
    color: #29abe2;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    text-transform: uppercase;
}

.photo-btn:hover {
    background: #29abe2;
    color: #0a0e27;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(41, 171, 226, 0.4);
}

/* Malé tlačítko pro seznam (4. a další místa) */
.photo-btn.small {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* --- MODAL (Vyskakovací okno) STYLES --- */
.modal {
    display: none; /* Skryté ve výchozím stavu */
    position: fixed;
    z-index: 2000;
    padding-top: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9); /* Černé pozadí s průhledností */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(41, 171, 226, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    height: 150px;
    font-size: 1.2rem;
}

/* Tlačítko zavřít (X) */
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
    color: #29abe2;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive úpravy pro mobil */
@media (max-width: 768px) {
    .result-action {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 15px;
        padding-left: 0;
        width: 100%;
        margin-top: 10px;
    }
    
    .list-header {
        display: flex; /* Zachovat header */
    }
    
    .list-header span:last-child {
        display: block; /* Ujistit se, že je vidět */
    }

    .row-action {
        text-align: right;
        flex: 0 0 auto;
    }
    
    .modal-content {
        width: 95%;
    }
}