/*
 * driver_profile.css
 * Štýly pre driver_profile.php – profil jazdca
 * Zladené s main.css, neprepísa body ani main.
 */

/* Lokálne farby pre profil */

:root {
    --profile-primary: #e10600;
    --profile-primary-dark: #b30500;
    --profile-accent: #00bcd4;
    --profile-text: #f0f0f0;
    --profile-text-light: #aaaaaa;
    --profile-bg-card: #12121b;
    --profile-bg-inner: #0a0a12;
    --profile-border: #303040;
    --profile-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    --profile-shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* ==========================
   Hlavný kontajner profilu
   ========================== */

.profile-page-main {
    max-width: 1200px;
    margin: 30px auto 40px;
    padding: 24px 22px;
    background: radial-gradient(circle at top, rgba(18, 24, 38, 1) 0, #050712 65%);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.85),
        0 0 30px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

.profile-page-main::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 10% 0%, rgba(225, 6, 0, 0.16) 0, transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(0, 188, 212, 0.16) 0, transparent 55%);
    opacity: 0.8;
    z-index: -1;
}

.profile-page-main > h1,
.profile-page-main > h2 {
    font-size: 2.1rem;
    color: #ffffff;
    text-align: center;
    margin-bottom: 26px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    position: relative;
}

.profile-page-main > h1::after,
.profile-page-main > h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    margin: 12px auto 0;
    background: linear-gradient(90deg, #e10600, #00bcd4);
    border-radius: 999px;
}

/* ==========================
   Header jazdca
   ========================== */

.driver-profile-header {
    height: 360px;
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    box-shadow: var(--profile-shadow);
    position: relative;
    overflow: hidden;
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    padding: 30px;
    background-color: #1a1a1a; /* fallback ak nie je background-image */
}

.driver-profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.15));
    z-index: 1;
}

.driver-profile-info {
    display: flex;
    align-items: flex-end;
    gap: 26px;
    position: relative;
    z-index: 2;
    color: #fff;
    flex-wrap: wrap;
}

.profile-photo {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: var(--profile-shadow-soft);
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

.driver-name-details {
    display: flex;
    flex-direction: column;
}

.driver-name-details h1 {
    font-size: 3.2em;
    margin: 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
}

.nickname {
    font-size: 1.4em;
    color: var(--profile-text-light);
    margin: 5px 0 12px;
    font-style: italic;
    font-weight: 300;
}

.team-name {
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 5px solid;
    padding-left: 14px;
}

.team-name a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.team-name a:hover {
    color: var(--profile-primary);
}

.team-name span {
    color: var(--profile-text-light);
}

/* ==========================
   Grid – štatistiky a info
   ========================== */

.profile-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 26px;
}

/* Karty */

.profile-card {
    background: var(--profile-bg-card);
    padding: 22px;
    border-radius: 12px;
    box-shadow: var(--profile-shadow-soft);
    margin-bottom: 18px;
    border: 1px solid var(--profile-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.profile-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.9);
    border-color: rgba(225, 6, 0, 0.7);
}

.profile-card h2 {
    font-size: 1.6em;
    color: var(--profile-primary);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--profile-border);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Štatistiky – grid */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    text-align: center;
}

.stat-item {
    background-color: var(--profile-bg-inner);
    border-radius: 8px;
    padding: 16px 10px;
    border: 1px solid var(--profile-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-color: rgba(225, 6, 0, 0.7);
}

.stat-item .value {
    font-size: 2.1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.stat-item .label {
    font-size: 0.85em;
    color: var(--profile-text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Top 3 farebné rámiky */

.rank-gold { border-color: #ffd700; }
.rank-silver { border-color: #c0c0c0; }
.rank-bronze { border-color: #cd7f32; }

.rank-gold .value { color: #ffd700; }
.rank-silver .value { color: #c0c0c0; }
.rank-bronze .value { color: #cd7f32; }

/* Detaily jazdca – zoznam */

.driver-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.driver-details-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--profile-border);
    font-size: 1em;
}

.driver-details-list li:last-child {
    border-bottom: none;
}

.driver-details-list li strong {
    color: var(--profile-text-light);
}

/* Sociálne siete */

.social-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--profile-bg-inner);
    color: #fff;
    font-size: 1.3em;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 18px rgba(0,0,0,0.7);
}

.twitch:hover { background-color: #9146ff; }
.youtube:hover { background-color: #ff0000; }
.twitter:hover { background-color: #1da1f2; }
.instagram:hover { background-color: #c13584; }
.facebook:hover { background-color: #1877f2; }

/* ==========================
   Taby + tabuľka pretekov
   ========================== */

.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    border-bottom: 2px solid var(--profile-border);
}

.tabs-nav .tab-link {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.98em;
    font-weight: bold;
    color: var(--profile-text-light);
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 8px 8px 0 0;
    position: relative;
    top: 2px;
}

.tabs-nav .tab-link:hover {
    color: var(--profile-primary);
}

.tabs-nav .tab-link.active {
    color: var(--profile-primary);
    background-color: var(--profile-bg-card);
    border: 2px solid var(--profile-border);
    border-bottom-color: var(--profile-bg-card);
}

.tab-pane {
    display: none;
    animation: fadeInProfile 0.4s ease-in-out;
}

.tab-pane.active {
    display: block;
}

.tabs-content {
    background-color: var(--profile-bg-card);
    padding: 18px 16px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.7);
    margin-top: -2px;
}

/* Tabuľka histórie pretekov */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed;
}

.data-table thead th {
    background-color: var(--profile-bg-inner);
    color: var(--profile-primary);
    padding: 12px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.08em;
    border-bottom: 3px solid var(--profile-primary);
}

.data-table thead th:first-child { text-align: left; }
.data-table thead th:last-child { text-align: center; }

.data-table tbody tr {
    transition: background-color 0.2s ease, transform 0.15s ease;
    border-bottom: 1px solid var(--profile-border);
}

.data-table tbody tr:hover {
    background-color: rgba(225, 6, 0, 0.12);
    transform: scale(1.01);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table td {
    padding: 10px 12px;
    vertical-align: middle;
    text-align: center;
    font-size: 0.9rem;
}

.data-table td:first-child { text-align: left; }
.data-table td:last-child { text-align: center; }

.data-table a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.data-table a:hover {
    color: var(--profile-primary);
}

.position-cell {
    font-weight: bold;
    font-size: 1.1em;
}

.podium-position {
    background-color: var(--profile-bg-inner);
    border-radius: 5px;
    padding: 4px 8px;
    font-weight: bold;
    display: inline-block;
    min-width: 38px;
}

.podium-1 {
    color: #fff;
    background-color: #ffd700;
    border: 2px solid #a87d00;
}

.podium-2 {
    color: #fff;
    background-color: #c0c0c0;
    border: 2px solid #7a7a7a;
}

.podium-3 {
    color: #fff;
    background-color: #cd7f32;
    border: 2px solid #8b4513;
}
/* ==========================
   OBS / widget link + náhľad
   ========================== */

.widget-section {
    margin-top: 26px;
}

.widget-link-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.widget-link-container input {
    flex-grow: 1;
    padding: 8px 10px;
    border: 1px solid var(--profile-border);
    background-color: var(--profile-bg-inner);
    color: var(--profile-text);
    border-radius: 6px;
    font-size: 0.9rem;
}

.widget-link-container button {
    padding: 8px 12px;
    background-color: var(--profile-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.widget-link-container button:hover {
    background-color: var(--profile-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.7);
}

/* celý blok s náhľadom */

.widget-preview-container {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--profile-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.widget-preview-container h3 {
    font-size: 1.2rem;
    color: var(--profile-primary);
    margin: 0;
}

/* rámik s 16:9 pomerom, responzívny */

.widget-frame-wrapper {
    width: 100%;
    max-width: 700px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--profile-border);
    background-color: var(--profile-bg-card);
    box-shadow: 0 10px 24px rgba(0,0,0,0.85);
}

/* samotný iframe / obrázok */

.widget-preview {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* mobil – trochu menšie odsadenie */

@media (max-width: 768px) {
    .widget-preview-container {
        align-items: stretch;
    }

    .widget-frame-wrapper {
        max-width: 100%;
    }

    .widget-link-container {
        flex-direction: column;
    }

    .widget-link-container button {
        width: 100%;
        justify-content: center;
    }
}


/* ==========================
   Animácia + responzivita
   ========================== */

@keyframes fadeInProfile {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet */

@media (max-width: 992px) {

    .profile-page-main {
        margin: 24px auto 30px;
        padding: 18px 16px;
    }

    .driver-profile-header {
        height: 300px;
        padding: 22px;
    }

    .driver-profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
        border-width: 4px;
        margin-bottom: 8px;
    }

    .driver-name-details h1 {
        font-size: 2.6em;
    }

    .profile-grid-container {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tabs-nav {
        flex-wrap: wrap;
    }
}

/* Mobil */

@media (max-width: 768px) {

    .profile-page-main {
        margin: 18px auto 24px;
        padding: 14px 10px;
        border-radius: 14px;
    }

    .driver-profile-header {
        height: auto;
        min-height: 260px;
        padding: 18px;
        align-items: flex-end;
    }

    .tabs-nav .tab-link {
        padding: 9px 14px;
        font-size: 0.9em;
    }

    /* Tabuľka ako karty na mobile */
    .data-table thead {
        display: none;
    }

    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--profile-border);
        border-radius: 8px;
        padding: 8px;
    }

    .data-table td {
        text-align: right;
        padding: 4px 12px;
        border-bottom: none;
        position: relative;
        font-size: 0.86rem;
    }

    .data-table td:before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        position: absolute;
        left: 12px;
        color: var(--profile-text-light);
        font-size: 0.75rem;
    }

    .data-table .hide-mobile {
        display: none;
    }
}

/* Malé mobily */

@media (max-width: 430px) {
    .driver-name-details h1 {
        font-size: 2.2em;
    }

    .nickname {
        font-size: 1.1em;
    }
}
