/* ============================================
   BIRDS PAGE - SPECIFIC STYLES
   ============================================ */

/* Birds Hero Section */
.birds-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 120px;
    padding-bottom: var(--spacing-xl);
    background: var(--gradient-hero);
    transition: background 0.3s ease;
}

.birds-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 1s ease;
}

.birds-hero .hero-title {
    margin-bottom: var(--spacing-md);
}

.birds-hero .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

/* Stats Section */
.birds-stats-section {
    background: var(--bg-primary);
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.haikubox-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: 20px;
    text-align: center;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 32px var(--color-shadow);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 12px 32px rgba(212, 165, 116, 0.2);
}

.stat-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Recent Activity Section */
.recent-activity-section {
    background: var(--bg-primary);
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
}

.recent-activity-container {
    max-width: 900px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.recent-detections {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: var(--spacing-md);
    min-height: 200px;
}

/* Detection Item */
.detection-item {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border: 2px solid transparent;
    transition: all var(--transition-smooth);
}

.detection-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

[data-theme="dark"] .detection-item:hover {
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.15);
}

.detection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
    gap: var(--spacing-sm);
}

.detection-bird {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.detection-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.detection-sci-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.detection-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.time-relative {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.time-exact {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.detection-audio {
    margin-top: var(--spacing-xs);
}

/* Activity Timeline */
.activity-timeline {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.timeline-header {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.timeline-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.timeline-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    height: 150px;
    padding: var(--spacing-sm) 0;
    margin-top: var(--spacing-sm);
}

.timeline-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    height: 100%;
}

.bar-fill {
    width: 80%;
    background: var(--gradient-primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: all var(--transition-smooth);
}

.timeline-bar:hover .bar-fill {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.timeline-bar.current-hour .bar-fill {
    background: linear-gradient(135deg, #D4A574 0%, #8B7355 100%);
    box-shadow: 0 0 12px rgba(212, 165, 116, 0.5);
}

.bar-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    margin-bottom: 0.25rem;
    min-height: 18px;
}

.timeline-bar:hover .bar-count {
    opacity: 1;
}

.bar-label {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-bar.current-hour .bar-label {
    color: var(--color-primary);
    font-weight: 700;
}

/* Audio Player Styling */
.bird-audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    outline: none;
}

.bird-audio::-webkit-media-controls-panel {
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.bird-audio::-webkit-media-controls-play-button,
.bird-audio::-webkit-media-controls-mute-button {
    background-color: var(--color-primary);
    border-radius: 50%;
}

.bird-audio::-webkit-media-controls-current-time-display,
.bird-audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

.bird-audio::-webkit-media-controls-timeline {
    background: var(--bg-primary);
    border-radius: 4px;
}

/* Bird List Section */
.bird-list-section {
    background: var(--bg-secondary);
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.bird-list-container {
    max-width: 900px;
    margin: 0 auto;
}

.bird-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.bird-list-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.bird-list-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.haikubox-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.haikubox-link:hover {
    transform: translateX(4px);
    color: var(--color-accent);
}

.bird-list {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: var(--spacing-md);
    min-height: 400px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.spinner-icon {
    width: 60px;
    height: 60px;
    margin-bottom: var(--spacing-sm);
    animation: spin 1s linear infinite;
}

.spinner-path {
    stroke: var(--color-primary);
    stroke-linecap: round;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Bird Item */
.bird-item {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: 12px;
    transition: all var(--transition-smooth);
    margin-bottom: var(--spacing-xs);
    border: 2px solid transparent;
}

.bird-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.bird-item.expanded {
    background: var(--bg-secondary);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-shadow);
}

[data-theme="dark"] .bird-item.expanded {
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.2);
}

.bird-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bird-info {
    flex: 1;
}

.bird-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.bird-header:hover .bird-name {
    color: var(--color-primary);
}

.bird-name-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bird-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.bird-sci-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.bird-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bird-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.bird-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* Bird Details (Expandable) */
.bird-details {
    display: none;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
    animation: fadeIn 0.3s ease;
}

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

.bird-details > div {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.bird-details > div:last-of-type {
    margin-bottom: var(--spacing-sm);
}

.bird-scientific,
.bird-family,
.bird-order {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.bird-scientific strong,
.bird-family strong,
.bird-order strong {
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.ebird-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-smooth);
    margin-top: 0.5rem;
}

.ebird-link:hover {
    background: var(--color-accent);
    transform: translateX(4px);
}

[data-theme="dark"] .ebird-link {
    background: var(--color-primary);
    color: var(--bg-primary);
}

[data-theme="dark"] .ebird-link:hover {
    background: var(--color-accent);
}

/* Empty/Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.error-state {
    color: #E53E3E;
}

/* Info Section */
.haikubox-info-section {
    background: var(--bg-primary);
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.haikubox-info {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 2px dashed var(--color-primary);
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: 24px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.badge-icon {
    width: 20px;
    height: 20px;
}

.info-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.info-links {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.info-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--color-primary);
    text-decoration: none;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.info-link:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

[data-theme="dark"] .info-link:hover {
    color: var(--bg-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .birds-hero {
        min-height: 40vh;
        padding-top: 100px;
    }

    .bird-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bird-list-header h2 {
        font-size: 1.5rem;
    }

    .bird-item {
        grid-template-columns: 40px 1fr;
    }

    .bird-rank {
        font-size: 1.25rem;
    }

    .bird-name {
        font-size: 1rem;
    }

    .bird-count {
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .haikubox-stats {
        grid-template-columns: 1fr;
    }

    .info-links {
        flex-direction: column;
    }

    .info-link {
        width: 100%;
        justify-content: center;
    }

    .detection-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detection-time {
        align-items: flex-start;
        text-align: left;
        margin-top: 0.25rem;
    }

    .detection-name {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .timeline-chart {
        gap: 0.25rem;
        height: 120px;
    }

    .bar-label {
        font-size: 0.65rem;
    }

    .timeline-header h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 2rem;
    }

    .bird-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
