/* === 2026年最新デザイン (Based on _moto/index.html) === */
:root {
    --primary: linear-gradient(135deg, #d4af37 0%, #f4e4c1 100%);
    --secondary: linear-gradient(135deg, #c9a961 0%, #e8d5a8 100%);
    --accent: linear-gradient(135deg, #b8941f 0%, #d4af37 100%);
    --success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(212, 175, 55, 0.2);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 15px 45px 0 rgba(0, 0, 0, 0.4);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-light: #f4f4f5;
    --gold: #d4af37;
    --gold-light: #f4e4c1;
    --dark-bg: #1a1625;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1625 0%, #2d1b3d 50%, #1f1833 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(244, 228, 193, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(201, 169, 97, 0.05) 0%, transparent 50%);
    animation: gradient-shift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../media/bg_light.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradient-shift {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    padding: 60px 20px 40px;
}

.header h1 {
    font-family: "Shizuru", system-ui;
    font-style: normal;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    background: linear-gradient(135deg, #FDE68A 0%, #d4af37 25%, #FFFBEB 50%, #d4af37 75%, #FDE68A 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
    animation: shimmer 8s linear infinite alternate, title-pulse 3s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

@keyframes title-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5));
    }

    100% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.8));
    }
}

.header h1 i {
    font-size: 0.8em;
    background: linear-gradient(to bottom, #fff 0%, #fef3c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.header a {
    text-decoration: none;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #FDE68A;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 10px 5px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    border-color: rgba(212, 175, 55, 0.5);
}

.badge i {
    color: var(--gold);
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(212, 175, 55, 0.1);
    transition: all 0.3s;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 24px;
    margin-top: 30px;
}

.search-panel {
    flex: 1;
    min-width: 0;
}

.panel-card {
    padding: 32px;
    margin-bottom: 20px;
}

.panel-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-card h2 i {
    color: var(--gold);
    font-size: 0.9em;
}

.search-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.method-box {
    padding: 24px;
    background: #ffffff;
    border-radius: 14px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.method-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.5);
}

.method-box h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.method-box h3 i {
    color: #b8941f;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #ffffff;
    color: #1a1a2e;
    font-weight: 500;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Realtime Coords */
.realtime-coords {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.8;
    min-width: 80px;
    text-align: right;
}

/* Sample Locations */
.sample-locations {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 24px;
}

.sample-locations h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sample-locations h3 i {
    color: #aaa;
}

.btn-sample {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    background: #f9fafb;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sample:hover {
    background: #fff;
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 11px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4c1 100%);
    color: #1a1625;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.6);
}

.btn-search {
    width: 100%;
    margin-top: 16px;
    font-size: 1.1rem;
    padding: 16px;
}

.info-box {
    background: rgba(244, 228, 193, 0.15);
    border-left: 4px solid var(--gold);
    padding: 14px 18px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 0.9rem;
    color: #3b4254;
}

.map-container {
    flex: 0 0 480px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
}

.map-card {
    padding: 24px;
}

.map-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a2e;
}

#map {
    height: 550px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 60px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top: 4px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.results-container {
    margin-top: 30px;
}

.result-stats {
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    color: #1a1625;
    padding: 16px 28px;
    margin: 20px;
    border-radius: 14px;
    text-align: center;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
}

.salon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 0 20px 40px;
    margin-top: 30px;
}

.salon-card {
    padding: 24px;
    cursor: auto;
    /* Remove pointer cursor from whole card since we have specific links */
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.salon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.salon-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1a1a2e;
}

.salon-card .features-container {
    flex-grow: 1;
    /* This pushes the bottom content down */
    margin-bottom: 15px;
}

.features-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    line-height: 1.5;
}

.read-more-link {
    color: var(--gold);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    display: inline-block;
}

.read-more-link:hover {
    color: #b8941f;
}

.salon-footer {
    margin-top: auto;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.salon-card p {
    margin: 10px 0;
    font-size: 0.92rem;
    color: #4b5563;
}

.salon-distance {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #c9a961 100%);
    color: #1a1625;
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .map-container {
        flex: 1;
        position: relative;
        max-height: none;
    }
}

@media (max-width: 768px) {

    .search-methods,
    .salon-list {
        grid-template-columns: 1fr;
    }
}

/* Results Header Improved */
.results-header {
    background: linear-gradient(135deg, #1a1625 0%, #2d1b3d 100%);
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.results-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #d4af37 !important;
}

/* Demographics Charts */
.demographics-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #e5e7eb;
}

.demo-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-chart-container {
    margin-bottom: 16px;
}

.demo-label {
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.bar-chart {
    display: flex;
    width: 100%;
    height: 18px;
    /* Increased height */
    background-color: #e2e8f0;
    /* Darker background for contrast */
    border-radius: 9px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    /* Inner shadow for depth */
}

.bar-segment {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    /* Separator */
}

.bar-segment:last-child {
    border-right: none;
}

.bar-segment:hover {
    filter: brightness(1.1);
    z-index: 10;
}

/* Colors with Premium Gradients */
.bg-men {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    /* Blue gradient */
}

.bg-women {
    background: linear-gradient(180deg, #f472b6 0%, #ec4899 100%);
    /* Pink gradient */
}

.bg-other {
    background-color: #9ca3af;
}

/* Age colors - Spectrum Gradient for easy distinction */
.bg-age-10 {
    background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 100%);
}

/* Cyan - Teens */
.bg-age-20 {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
}

/* Green - 20s */
.bg-age-30 {
    background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
}

/* Yellow - 30s */
.bg-age-40 {
    background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
}

/* Orange - 40s */
.bg-age-50 {
    background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

/* Red - 50s+ */

/* Legend for Ages */
.age-legend {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
    background: #f8fafc;
    padding: 8px;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Custom Tooltip (Instant Hover) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(26, 22, 37, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease, transform 0.1s ease;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-weight: 500;
    visibility: hidden;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-1px);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(26, 22, 37, 0.95) transparent transparent transparent;
    opacity: 0;
    transition: opacity 0.1s ease;
    visibility: hidden;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Card Layout Adjustments for Bottom Alignment */
.salon-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Ensure footer pushes down if needed, though structure handles it */
    height: 100%;
}

.features-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-bottom: 0 !important;
    /* Override previous margin */
}

/* Features Text Area - give it min-height or just let it flow */
.features-text {
    margin-bottom: 15px;
}

/* Push demographics to bottom of features container */
.demographics-section {
    margin-top: auto;
    /* This aligns the charts to the bottom of the valid space */
    border-top: 1px solid #f3f4f6;
    /* Lighter cleaner border */
    background: #fff;
    /* Ensure bg is white */
}

/* Stats Dashboard Premium Design */
.stats-dashboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 30px;
    margin: 25px 0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    color: #1a1a2e;
    /* Ensure text is dark on white background */
}

/* Background decoration */
.stats-dashboard::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.stats-header {
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
    padding-bottom: 15px;
    position: relative;
    z-index: 1;
}

.stats-header h3 {
    font-size: 1.25rem;
    color: #1a1a2e;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.stats-header h3 i {
    color: #d4af37;
    background: #fff9e6;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(212, 175, 55, 0.15);
}

.stats-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-left: 46px;
    font-weight: 500;
}

/* Grid Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.stats-row {
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: rgba(212, 175, 55, 0.3);
}

.stat-card.wide {
    grid-column: span 2;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card.full-width {
    width: 100%;
}

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

    .stat-card.wide {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.wide {
        grid-column: span 1;
    }
}

/* Metric Styles */
.stat-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fdfbf7 0%, #fff 100%);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #d4af37;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.stat-content {
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a1625;
    line-height: 1;
    background: linear-gradient(135deg, #1a1625 30%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-unit {
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 600;
    margin-left: 4px;
    -webkit-text-fill-color: #9ca3af;
    /* Override gradient */
}

/* Gender Chart Styling */
.stat-bar-container {
    margin-top: 15px;
    width: 100%;
}

.stat-bar {
    height: 24px;
    width: 100%;
    background: #f3f4f6;
    /* Track color */
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Depth */
}

.stat-bar-seg {
    height: 100%;
    position: relative;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy animation */
}

/* Shine effect on segments */
.stat-bar-seg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
}

/* Legend Styling */
.stat-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-legend span i {
    margin-right: 5px;
    font-size: 1.1em;
}

/* Age Stats Revamp */
.age-stats-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    padding: 10px 0;
}

.age-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.age-group small {
    width: 40px;
    font-weight: 700;
    color: #4b5563;
    font-size: 0.85rem;
}

.stat-bar.mini {
    height: 14px;
    border-radius: 7px;
}

.age-legend-static {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
    color: #6b7280;
    justify-content: center;
    font-weight: 500;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Chart Text Overlay */
.chart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Detailed Search Styles */
/* Detailed Search Styles - Premium Design */
.checkbox-pill {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 5px;
    /* compact horizontal padding, let flex fill width */
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 1);
    user-select: none;
    width: 100%;
    overflow: hidden;
}

/* Hide default checkbox completely */
.checkbox-pill input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Hover Effect */
.checkbox-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.15);
    color: #d4af37;
    background: linear-gradient(145deg, #fffcf5, #ffffff);
}

/* Active/Checked State */
.checkbox-pill:has(input:checked) {
    background: linear-gradient(135deg, #d4af37 0%, #c4a132 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animated Checkmark Icon */
.checkbox-pill::before {
    content: '\f00c';
    /* FontAwesome Check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0;
    font-size: 0.9em;
    opacity: 0;
    width: 0;
    transform: scale(0) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    color: #fff;
}

.checkbox-pill:has(input:checked)::before {
    opacity: 1;
    width: 20px;
    /* Space for icon */
    transform: scale(1) rotate(0deg);
    margin-right: 4px;
}

/* Ripple/Glow Animation on Click */
.checkbox-pill:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.age-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .age-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

#detailedSearchArea {
    transition: all 0.3s ease;
}