/* ==========================================================================
   profile-modern.css - nur auf profile.php geladen
   WICHTIG: Jede Regel ist unter .profile-page gescoped. Die Klassen
   (.profile-card, .profile-tab, .profile-stat-grid, ...) werden auch von
   profile-edit.php und ggf. anderen Seiten verwendet - die bleiben dadurch
   unverändert, nur profile.php bekommt den neuen Look.
   Tab-/Range-Umschaltung passiert weiterhin per JS über dieselben Klassen/
   IDs/data-Attribute (profile-tabs.js) - hier wird nur das Aussehen
   verändert, keine Struktur, die JS-Selektoren betreffen würde.
   ========================================================================== */

.profile-page {
    display: block;
    background: var(--color-background, #ffffff);
}

/* ---------- COVER-BAND HINTER DER PROFILKARTE ---------- */

.profile-page .profile-section {
    position: relative;
    padding-top: 0;
    padding-bottom: var(--space-8, 4.5rem);
    overflow: hidden;
}

.profile-page .profile-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, #0f2a5c 0%, #14336e 55%, #1d4ed8 100%);
    z-index: 0;
}

.profile-page .profile-section > .container {
    position: relative;
    z-index: 1;
    padding-top: 3.25rem;
}

/* ---------- PROFILKARTE ---------- */

.profile-page .profile-card {
    position: relative;
    text-align: center;
    padding: 2.25rem 2rem 2rem;
    border-radius: var(--radius-lg, 22px);
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e5eaf2);
    box-shadow: 0 24px 48px rgba(15, 42, 92, .16);
}

.profile-page .profile-avatar {
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto .9rem;
    border: 4px solid #fff;
    box-shadow: 0 10px 22px rgba(15, 42, 92, .22);
    background: var(--color-surface, #f3f6fb);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-page .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-page .profile-name {
    font-size: 1.45rem;
    margin: 0 0 .15rem;
    color: var(--color-text, #1e293b);
}

.profile-page .profile-username {
    color: var(--color-text-muted, #64748b);
    margin-bottom: .85rem;
}

.profile-page .profile-bio {
    max-width: 480px;
    margin: 0 auto .9rem;
    color: var(--color-text, #1e293b);
}

.profile-page .profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.35rem;
}

.profile-page .profile-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border-radius: var(--radius-full, 999px);
    background: rgba(37, 99, 235, .1);
    color: var(--color-primary, #2563eb);
    font-size: .82rem;
    font-weight: 500;
}

/* ---------- TABS ---------- */

.profile-page .profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    justify-content: center;
    margin: 2rem 0 1.5rem;
    padding: .35rem;
    background: var(--color-surface, #f3f6fb);
    border-radius: var(--radius-full, 999px);
    border: 1px solid var(--color-border, #e5eaf2);
}

.profile-page .profile-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-full, 999px);
    border: none;
    background: transparent;
    color: var(--color-text-muted, #64748b);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.profile-page .profile-tab:hover {
    color: var(--color-text, #1e293b);
}

.profile-page .profile-tab.is-active {
    background: var(--color-primary, #2563eb);
    color: #fff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .28);
}

/* ---------- KARTEN INNERHALB DER TAB-PANELS ---------- */

.profile-page .profile-tab-panel .card {
    border-radius: var(--radius-lg, 18px);
    border: 1px solid var(--color-border, #e5eaf2);
    background: var(--color-background, #fff);
    box-shadow: 0 6px 18px rgba(15, 42, 92, .05);
}

.profile-page .settings-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.02rem;
    margin-bottom: 1rem;
}

.profile-page .profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 1rem;
    text-align: center;
}

.profile-page .profile-stat {
    padding: .75rem .5rem;
    border-radius: var(--radius-md, 12px);
    background: var(--color-surface, #f3f6fb);
}

.profile-page .profile-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary-dark, #0f2a5c);
}

.profile-page .profile-stat-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .76rem;
    color: var(--color-text-muted, #64748b);
    margin-top: .2rem;
}

/* ---------- ROUTEN ---------- */

.profile-page .routes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.profile-page .route-card-stats {
    display: flex;
    gap: 1rem;
    margin: .5rem 0 .75rem;
    font-size: .85rem;
    color: var(--color-text-muted, #64748b);
}

.profile-page .route-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

/* ---------- FAHRRÄDER ---------- */

.profile-page .tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: var(--radius-full, 999px);
    background: rgba(37, 99, 235, .12);
    color: var(--color-primary, #2563eb);
    font-size: .72rem;
    font-weight: 600;
    margin: .3rem 0 .4rem;
}

/* ---------- AKTIVITÄTEN ---------- */

.profile-page .activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--color-border, #e5eaf2);
}

.profile-page .activity-item:last-child {
    border-bottom: none;
}

/* ---------- STATS-ZEITRAUM-BUTTONS ---------- */

.profile-page .stats-range-btn {
    border-radius: var(--radius-full, 999px);
}

.profile-page .stats-range-btn.is-active {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
}

/* ---------- "PROFIL NICHT GEFUNDEN"-ZUSTAND ---------- */

.profile-page .hero {
    padding: 5.5rem 0;
    text-align: center;
}

.profile-page .auth-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(37, 99, 235, .1);
    color: var(--color-primary, #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 767px) {
    .profile-page .profile-section::before {
        height: 160px;
    }

    .profile-page .profile-section > .container {
        padding-top: 2rem;
    }

    .profile-page .profile-card {
        padding: 1.75rem 1.25rem 1.5rem;
    }

    .profile-page .routes-list {
        grid-template-columns: 1fr;
    }
}
