/* Dashboard Styles - Aligned with MyRaceHub Design System */

/* ============================================================================
   Dashboard Container
   ============================================================================ */

.dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg, 2.5rem) var(--space-md, 1.5rem);
    animation: fadeInUp 0.6s var(--ease-out) both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Hero Section - Profile Header
   ============================================================================ */

.dashboard-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 30px;
    background: linear-gradient(135deg, var(--surface, #fff) 0%, rgba(79, 179, 217, 0.1) 100%);
    border-radius: var(--radius-xl, 16px);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0, 78, 137, 0.1));
    border: 2px solid var(--border, #E0E5EB);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ocean-deep, #004E89), var(--ocean-bright, #1A7FA0), var(--sunset-orange, #FF6B35));
}

.hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ocean-deep, #004E89) 0%, var(--ocean-bright, #1A7FA0) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 78, 137, 0.3);
    animation: popIn 0.6s var(--ease-bounce, cubic-bezier(0.68, -0.55, 0.265, 1.55)) 0.2s both;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-avatar .avatar-emoji {
    font-size: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.hero-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.hero-info {
    flex: 1;
    animation: slideInLeft 0.6s var(--ease-out, cubic-bezier(0.19, 1, 0.22, 1)) 0.2s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-info h2 {
    margin: 0;
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary, #0A2540);
    letter-spacing: -0.02em;
}

.hero-flag {
    font-size: 1.5rem;
}

.hero-details {
    margin: 8px 0 4px;
    color: var(--text-secondary, #5A6C7D);
    font-size: 1rem;
    font-weight: 500;
}

.hero-tagline {
    margin: 4px 0 0;
    color: var(--text-secondary, #5A6C7D);
    font-style: italic;
    font-size: 0.95rem;
}

/* Hero Social Links */
.hero-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full, 20px);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast, 0.15s ease);
}

.strava-link {
    background: linear-gradient(135deg, #fc4c02 0%, #e34402 100%);
    color: white;
}

.strava-link:hover {
    background: linear-gradient(135deg, #e34402 0%, #c93a02 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(252, 76, 2, 0.3);
}

.strava-link svg {
    flex-shrink: 0;
}

.parkrun-link {
    background: linear-gradient(135deg, #0303d3 0%, #0202a8 100%);
    color: white;
}

.parkrun-link:hover {
    background: linear-gradient(135deg, #0202a8 0%, #01017d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 3, 211, 0.4);
}

.parkrun-link svg {
    flex-shrink: 0;
}

/* ============================================================================
   Share Profile Section
   ============================================================================ */

.share-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--surface-light, #F8FAFB) 0%, rgba(79, 179, 217, 0.05) 100%);
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border: 1px solid var(--border, #E0E5EB);
    animation: fadeInUp 0.5s var(--ease-out) 0.15s both;
}

.share-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.visibility-select {
    padding: 8px 32px 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
    border: 2px solid var(--border, #E0E5EB);
    background: white;
    color: var(--text-primary, #0A2540);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A6C7D' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s var(--ease-out);
}

.visibility-select:hover {
    border-color: var(--ocean-light, #4FB3D9);
}

.visibility-select:focus {
    outline: none;
    border-color: var(--ocean-bright, #1A7FA0);
    box-shadow: 0 0 0 3px rgba(26, 127, 160, 0.15);
}

/* Color-code based on selected value */
.visibility-select option[value="only_me"] { color: #991b1b; }
.visibility-select option[value="friends"] { color: #92400e; }
.visibility-select option[value="everyone"] { color: #065f46; }

.share-text {
    font-size: 0.9rem;
    color: var(--text-secondary, #5A6C7D);
    font-weight: 500;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}

.share-url-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border, #E0E5EB);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
    background: white;
    color: var(--text-primary, #0A2540);
    min-width: 200px;
    transition: border-color 0.2s var(--ease-out);
}

.share-url-input:focus {
    outline: none;
    border-color: var(--ocean-bright, #1A7FA0);
}

.share-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-copy {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--ocean-deep, #004E89), var(--ocean-bright, #1A7FA0));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 2px 8px rgba(0, 78, 137, 0.25);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.35);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy.copied {
    background: linear-gradient(135deg, var(--eucalypt, #2A9D8F), #3DBAA2);
}

.share-settings-link {
    font-size: 0.85rem;
    color: var(--ocean-bright, #1A7FA0);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.share-settings-link:hover {
    color: var(--ocean-deep, #004E89);
    text-decoration: underline;
}

/* ============================================================================
   CTA Section (Demo Mode)
   ============================================================================ */

.cta-section {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 78, 137, 0.1);
    border: 2px solid var(--border, #E0E5EB);
    margin-bottom: 24px;
}

.cta-section h3 {
    margin: 0 0 16px;
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ocean-deep, #004E89);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.feature-list li {
    padding: 10px 0;
    padding-left: 32px;
    position: relative;
    color: var(--text-secondary, #5A6C7D);
    font-weight: 500;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--eucalypt, #2A9D8F);
    font-weight: bold;
    font-size: 1.1rem;
}

.login-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.login-buttons .btn {
    padding: 12px 28px;
}

/* ============================================================================
   Dashboard Sections
   ============================================================================ */

.dashboard-section {
    background: var(--surface, white);
    border-radius: var(--radius-xl, 16px);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0, 78, 137, 0.08));
    border: 2px solid var(--border, #E0E5EB);
    animation: fadeInUp 0.6s var(--ease-out) both;
    position: relative;
    transition: all var(--transition-normal, 0.3s) var(--ease-out);
}

.dashboard-section:nth-child(1) { animation-delay: 0.1s; }
.dashboard-section:nth-child(2) { animation-delay: 0.2s; }
.dashboard-section:nth-child(3) { animation-delay: 0.3s; }
.dashboard-section:nth-child(4) { animation-delay: 0.4s; }

.dashboard-section:hover {
    box-shadow: 0 8px 30px rgba(0, 78, 137, 0.12);
}

.dashboard-section h3 {
    margin: 0 0 20px;
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ocean-deep, #004E89);
    position: relative;
    display: inline-block;
}

.dashboard-section h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--ocean-bright, #1A7FA0), var(--sunset-orange, #FF6B35));
    border-radius: 2px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
}

.section-header h3::after {
    display: none;
}

.view-all-link {
    color: var(--ocean-bright, #1A7FA0);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s var(--ease-out);
}

.view-all-link:hover {
    color: var(--sunset-orange, #FF6B35);
    text-decoration: underline;
}

/* ============================================================================
   Personal Bests Grid
   ============================================================================ */

.pb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.pb-card {
    background: var(--surface-light, #F8FAFB);
    border-radius: var(--radius-lg, 12px);
    padding: 18px 14px;
    text-align: center;
    transition: all var(--transition-normal, 0.3s) var(--ease-out);
    border: 2px solid var(--border, #E0E5EB);
    animation: popIn 0.5s var(--ease-bounce) both;
}

.pb-card:nth-child(1) { animation-delay: 0.1s; }
.pb-card:nth-child(2) { animation-delay: 0.15s; }
.pb-card:nth-child(3) { animation-delay: 0.2s; }
.pb-card:nth-child(4) { animation-delay: 0.25s; }
.pb-card:nth-child(5) { animation-delay: 0.3s; }
.pb-card:nth-child(6) { animation-delay: 0.35s; }
.pb-card:nth-child(7) { animation-delay: 0.4s; }

.pb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 78, 137, 0.15);
    border-color: var(--ocean-light, #4FB3D9);
}

.pb-card.has-pb {
    background: linear-gradient(135deg, rgba(79, 179, 217, 0.15) 0%, rgba(255, 107, 53, 0.08) 100%);
    border-color: var(--ocean-light, #4FB3D9);
}

.pb-card.has-pb:hover {
    border-color: var(--sunset-orange, #FF6B35);
}

/* Sport Section Layout for grouped PBs - uses grid for auto layout */
.pb-sports-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.pb-sport-section {
    width: 100%;
}

.pb-sport-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary, #5A6C7D);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pb-sport-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    width: 100%;
}

/* When sport section takes full width (only one section), use more columns */
.pb-sport-section:only-child .pb-sport-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.pb-card.custom-pb {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15) 0%, rgba(255, 107, 53, 0.08) 100%);
    border-color: #9b59b6;
}

.pb-card.custom-pb:hover {
    border-color: #8e44ad;
}

.pb-distance {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary, #5A6C7D);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pb-time {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ocean-deep, #004E89), var(--sunset-orange, #FF6B35));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.pb-date {
    font-size: 0.75rem;
    color: var(--text-secondary, #5A6C7D);
    margin-top: 6px;
}

.pb-card:not(.has-pb) .pb-time {
    background: none;
    -webkit-text-fill-color: var(--text-muted, #6b7280);
    color: var(--text-muted, #6b7280);
    font-size: 1.2rem;
}

.pb-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: var(--text-secondary, #5A6C7D);
}

/* ============================================================================
   Upcoming Races
   ============================================================================ */

.upcoming-races {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-race-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface-light, #F8FAFB);
    border-radius: var(--radius-lg, 12px);
    transition: all var(--transition-normal, 0.3s) var(--ease-out);
    border: 2px solid transparent;
    animation: slideInRight 0.4s var(--ease-out) both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.upcoming-race-card:nth-child(1) { animation-delay: 0.1s; }
.upcoming-race-card:nth-child(2) { animation-delay: 0.15s; }
.upcoming-race-card:nth-child(3) { animation-delay: 0.2s; }
.upcoming-race-card:nth-child(4) { animation-delay: 0.25s; }
.upcoming-race-card:nth-child(5) { animation-delay: 0.3s; }

.upcoming-race-card:hover {
    background: white;
    border-color: var(--ocean-light, #4FB3D9);
    transform: translateX(6px);
    box-shadow: -4px 4px 16px rgba(0, 78, 137, 0.1);
}

.race-date-badge {
    background: linear-gradient(135deg, var(--ocean-deep, #004E89), var(--ocean-bright, #1A7FA0));
    color: white;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    min-width: 60px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 78, 137, 0.25);
}

.race-date-badge .day {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.race-date-badge .month {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.9;
}

.race-info {
    flex: 1;
    min-width: 0;
}

.race-info .race-name {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-weight: 600;
    color: var(--text-primary, #0A2540);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.race-info .race-distance {
    font-size: 0.9rem;
    color: var(--text-secondary, #5A6C7D);
    font-weight: 500;
}

.race-info .race-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.race-info .race-name a:hover {
    color: var(--ocean-bright, #1A7FA0);
}

/* ============================================================================
   Results Controls & Filters
   ============================================================================ */

.results-section {
    padding-bottom: 16px;
}

/* Dashboard Tip Banner */
.dashboard-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(79, 179, 217, 0.1) 0%, rgba(0, 78, 137, 0.05) 100%);
    border: 1px solid rgba(79, 179, 217, 0.3);
    border-radius: var(--radius-md, 10px);
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary, #677489);
}

.dashboard-tip .tip-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-tip .tip-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dashboard-tip .tip-text {
    line-height: 1.4;
}

.dashboard-tip .tip-text a {
    color: var(--ocean-deep, #004E89);
    font-weight: 600;
    text-decoration: none;
}

.dashboard-tip .tip-text a:hover {
    text-decoration: underline;
}

.dashboard-tip .tip-dismiss {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary, #677489);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dashboard-tip .tip-dismiss:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #1A2B3C);
}

.results-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-select {
    padding: 10px 14px;
    border: 2px solid var(--border, #E0E5EB);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
    background: white;
    min-width: 130px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.filter-select:hover {
    border-color: var(--ocean-light, #4FB3D9);
}

.filter-select:focus {
    outline: none;
    border-color: var(--ocean-bright, #1A7FA0);
    box-shadow: 0 0 0 3px rgba(26, 127, 160, 0.1);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 10px 14px;
    background: var(--surface-light, #F8FAFB);
    border-radius: 10px;
    white-space: nowrap;
    transition: all 0.2s var(--ease-out);
    border: 2px solid transparent;
    font-weight: 500;
    color: var(--text-secondary, #5A6C7D);
}

.filter-checkbox input {
    margin: 0;
    cursor: pointer;
    accent-color: var(--ocean-bright, #1A7FA0);
}

.filter-checkbox:hover {
    background: white;
    border-color: var(--ocean-light, #4FB3D9);
}

/* ============================================================================
   Result Link Badges
   ============================================================================ */

.event-with-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-name-link {
    color: var(--text-primary, #1A2B3C);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.event-name-link:hover {
    color: var(--ocean-deep, #004E89);
}

.event-name {
    font-weight: 600;
}

.result-link-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.result-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--surface-light, #F0F2F5);
    color: var(--text-secondary, #677489);
}

.result-link-badge:hover {
    transform: scale(1.1);
}

.result-link-badge.strava:hover {
    background: #fc4c02;
    color: white;
}

/* Strava "View on Strava" link styling - per Strava brand guidelines */
.view-on-strava {
    color: #FC5200;
    font-weight: 600;
    text-decoration: none;
}

.view-on-strava:hover {
    text-decoration: underline;
}

/* Powered by Strava attribution */
.powered-by-strava {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary, #5A6C7D);
}

.powered-by-strava svg {
    color: #FC5200;
}

.powered-by-strava a {
    color: #FC5200;
    font-weight: 600;
    text-decoration: none;
}

.powered-by-strava a:hover {
    text-decoration: underline;
}

.result-link-badge.results:hover {
    background: var(--ocean-deep, #004E89);
    color: white;
}

/* ============================================================================
   Stats Bar
   ============================================================================ */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface, white);
    border-radius: var(--radius-lg, 12px);
    padding: 18px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm, 0 2px 10px rgba(0, 78, 137, 0.06));
    border: 2px solid var(--border, #E0E5EB);
    transition: all var(--transition-normal, 0.3s) var(--ease-out);
    animation: popIn 0.5s var(--ease-bounce) both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; border-color: var(--sunset-orange, #FF6B35); }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 78, 137, 0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--ocean-bright, #1A7FA0), var(--sunset-orange, #FF6B35));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
    border-radius: 12px 12px 0 0;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card .stat-number {
    display: block;
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ocean-bright, #1A7FA0), var(--sunset-orange, #FF6B35));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #5A6C7D);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ============================================================================
   Results Table
   ============================================================================ */

.results-table-container {
    background: var(--surface, white);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 2px 10px rgba(0, 78, 137, 0.06));
    overflow: hidden;
    border: 2px solid var(--border, #E0E5EB);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table thead {
    background: linear-gradient(135deg, var(--ocean-deep, #004E89), var(--ocean-bright, #1A7FA0));
    color: white;
}

.results-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, #E0E5EB);
    vertical-align: middle;
}

.results-table tbody tr {
    transition: all 0.2s var(--ease-out);
    animation: fadeInRow 0.4s ease-out both;
}

.results-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.results-table tbody tr:nth-child(2) { animation-delay: 0.10s; }
.results-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.results-table tbody tr:nth-child(4) { animation-delay: 0.20s; }
.results-table tbody tr:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.results-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(79, 179, 217, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
}

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

/* Column specific styles */
.col-date {
    white-space: nowrap;
    color: var(--text-secondary, #5A6C7D);
    font-size: 0.85rem;
    font-weight: 500;
}

.col-event {
    font-weight: 600;
    color: var(--text-primary, #0A2540);
}

.col-event a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.col-event a:hover {
    color: var(--ocean-bright, #1A7FA0);
}

.col-event .mobile-distance {
    display: none;
}

.col-distance {
    white-space: nowrap;
}

.distance-badge {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, var(--sunset-orange, #FF6B35), var(--sunset-coral, #FF8B66));
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.25);
}

.col-time {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-primary, #0A2540);
}

/* Mobile links hidden on desktop - shown via mobile media query */
.col-time .mobile-links {
    display: none;
}

.time-with-pb {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pb-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
}

.pb-badge.current {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

.pb-badge.former {
    background: #e5e7eb;
    color: #6b7280;
}

.col-position {
    font-size: 0.85rem;
    color: var(--text-secondary, #5A6C7D);
}

.time-placeholder {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
}

/* Expandable row */
.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary, #5A6C7D);
    font-size: 0.8rem;
    transition: color 0.2s;
}

.expand-btn:hover {
    color: var(--ocean-bright, #1A7FA0);
}

.details-row {
    display: none;
    background: var(--surface-light, #F8FAFB);
}

.details-row.expanded {
    display: table-row;
}

.details-content {
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary, #5A6C7D);
}

.details-content .notes {
    font-style: italic;
}

/* ============================================================================
   Results Pagination
   ============================================================================ */

.results-pagination,
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
}

.pagination-btn {
    padding: 10px 18px;
    border: 2px solid var(--ocean-bright, #1A7FA0);
    background: transparent;
    color: var(--ocean-bright, #1A7FA0);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body, 'Space Grotesk', system-ui, sans-serif);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--ocean-deep, #004E89), var(--ocean-bright, #1A7FA0));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 78, 137, 0.25);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary, #5A6C7D);
    min-width: 100px;
    text-align: center;
    font-weight: 500;
}

/* ============================================================================
   Results Legend
   ============================================================================ */

.results-legend {
    margin-top: 24px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--surface-light, #F8FAFB) 0%, rgba(79, 179, 217, 0.05) 100%);
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border, #E0E5EB);
}

.results-legend h4 {
    margin: 0 0 14px;
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary, #5A6C7D);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item span.label {
    color: var(--text-secondary, #5A6C7D);
    font-weight: 500;
}

/* ============================================================================
   Empty States
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #5A6C7D);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ============================================================================
   Error Message
   ============================================================================ */

.error-message {
    text-align: center;
    padding: 60px 30px;
}

.error-message h2 {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    color: var(--ocean-deep, #004E89);
    margin-bottom: 12px;
}

.error-message p {
    color: var(--text-secondary, #5A6C7D);
    margin-bottom: 24px;
}

/* ============================================================================
   Mobile Responsiveness
   ============================================================================ */

@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--space-sm, 1rem);
    }

    .share-section {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .share-info {
        justify-content: center;
    }

    .share-actions {
        max-width: none;
    }

    .share-url-input {
        min-width: 0;
    }

    .share-settings-link {
        text-align: center;
    }

    .share-url-row {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-links {
        justify-content: center;
    }

    .dashboard-hero {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .hero-name-row {
        justify-content: center;
    }

    .hero-avatar {
        width: 100px;
        height: 100px;
    }

    .hero-avatar .avatar-emoji {
        font-size: 3rem;
    }

    .hero-info h2 {
        font-size: 1.5rem;
    }

    .pb-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .pb-card {
        padding: 14px 8px;
    }

    .pb-distance {
        font-size: 0.7rem;
    }

    .pb-time {
        font-size: 1rem;
    }

    .upcoming-race-card {
        padding: 14px;
        gap: 12px;
    }

    .race-date-badge {
        padding: 8px 12px;
        min-width: 50px;
    }

    .race-date-badge .day {
        font-size: 1.3rem;
    }

    /* Results Section Mobile */
    .results-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .filter-select {
        min-width: unset;
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .filter-checkbox {
        font-size: 0.85rem;
        padding: 8px 10px;
        grid-column: span 2;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .stat-card .stat-label {
        font-size: 0.65rem;
    }

    /* Card-based table layout for mobile */
    .results-table-container {
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .results-table {
        display: block;
    }

    .results-table thead {
        display: none;
    }

    .results-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .results-table tbody tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        background: white;
        border-radius: 12px;
        padding: 14px;
        box-shadow: 0 2px 10px rgba(0, 78, 137, 0.08);
        border: 2px solid var(--border, #E0E5EB);
    }

    .results-table tbody tr:hover {
        border-color: var(--ocean-light, #4FB3D9);
    }

    .results-table tbody tr.details-row {
        display: none;
        padding: 0 14px 14px;
        margin-top: -10px;
        border-radius: 0 0 12px 12px;
    }

    .results-table tbody tr.details-row.expanded {
        display: block;
    }

    .results-table td {
        padding: 0;
        border: none;
    }

    .results-table td.col-event {
        font-size: 0.95rem;
        font-weight: 600;
        order: 1;
    }

    .results-table td.col-event .mobile-distance {
        display: inline;
        font-weight: 400;
        color: var(--text-secondary, #5A6C7D);
    }

    .results-table td.col-date {
        font-size: 0.8rem;
        order: 2;
    }

    .results-table td.col-distance {
        display: none;
    }

    .results-table td.col-time {
        font-size: 0.9rem;
        order: 3;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .results-table td.col-links {
        display: none;
    }

    /* Show link icons inline with time on mobile */
    .results-table td.col-time .mobile-links {
        display: flex;
        gap: 6px;
        margin-left: auto;
    }

    .results-table td.col-position {
        display: none;
    }

    .results-table td:first-child {
        display: none;
    }

    .distance-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .results-legend {
        padding: 14px;
        margin-top: 16px;
    }

    .legend-items {
        gap: 14px;
    }

    .legend-item {
        font-size: 0.8rem;
    }

    .results-pagination,
    .pagination-controls {
        gap: 12px;
        padding: 14px;
    }

    .pagination-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .pb-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* PB grid uses full width on mobile - single column of sections, 2-col cards */
    .pb-sports-container {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .pb-sport-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }

    .pb-time {
        font-size: 1.1rem;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   Reduced Motion Support
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .pb-card:hover,
    .upcoming-race-card:hover,
    .stat-card:hover,
    .btn-copy:hover,
    .pagination-btn:hover {
        transform: none !important;
    }
}
