/* ======================================== */
/* COUNTRY DETAILS - AUDIO PLAYER */
/* ======================================== */

.audio-section,
.emotion-section,
.info-section {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    animation: fadeIn 0.5s var(--ease-standard);
    animation-fill-mode: both;
}

.audio-section { animation-delay: 0.1s; }
.emotion-section { animation-delay: 0.2s; }
.info-section { 
    animation-delay: 0.3s;
    border-bottom: none;
}

.audio-section h3,
.emotion-section h3,
.info-section h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
    color: var(--color-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ======================================== */
/* AUDIO PLAYER */
/* ======================================== */
.audio-player {
    background: linear-gradient(135deg, var(--color-bg) 0%, #ffffff 100%);
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.audio-player:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.play-btn:hover::before {
    opacity: 1;
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.audio-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.progress-bar {
    position: relative;
    height: 8px;
    background: linear-gradient(to right, var(--color-bg-secondary), var(--color-bg));
    border-radius: 4px;
    overflow: visible;
    cursor: pointer;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 4px;
    transition: width 0.1s linear;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(33, 128, 141, 0.4);
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: var(--shadow);
    transition: all var(--transition-fast);
}

.progress-bar:hover .progress-fill::after {
    width: 14px;
    height: 14px;
    right: -7px;
}

#progress-slider {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 24px;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.audio-controls > div:last-child {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    padding: var(--space-xs);
    display: flex;
    align-items: center;
    transition: all var(--transition-base);
    border-radius: var(--border-radius-sm);
}

.volume-btn:hover {
    color: var(--color-primary);
    background: var(--color-bg);
    transform: scale(1.1);
}

.volume-btn:active {
    transform: scale(0.95);
}

.volume-slider {
    width: 100px;
    height: 6px;
    background: linear-gradient(to right, var(--color-bg-secondary), var(--color-bg));
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.volume-slider:hover {
    height: 8px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-md);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
    transition: all var(--transition-fast);
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-md);
}

.audio-unavailable,
.audio-error {
    padding: var(--space-lg);
    background: var(--color-bg);
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px dashed var(--color-border);
}

.audio-unavailable {
    color: var(--color-text-light);
    font-style: italic;
}

.audio-error {
    color: var(--color-error);
    border-color: var(--color-error);
    background: rgba(220, 53, 69, 0.05);
}

/* ======================================== */
/* EMOTION BARS */
/* ======================================== */

.emotion-bar {
    width: 100%;
    height: 24px;
    background: var(--color-bg);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-inner);
}

.emotion-bar-fill {
    height: 100%;
    transition: width 0.6s var(--transition-bounce);
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: hidden;
}

.emotion-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 120s infinite;
}

.emotion-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

/* ======================================== */
/* INFO GRID */
/* ======================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    animation: fadeIn 0.6s var(--ease-standard);
}

.info-item {
    padding: var(--space-lg);
    background: linear-gradient(135deg, white 0%, var(--color-bg) 100%);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.info-item:hover::before {
    transform: scaleY(1);
}

.info-item strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* ======================================== */
/* RESPONSIVE - COUNTRY DETAILS */
/* ======================================== */

@media (max-width: 768px) {
    .audio-player {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .play-btn {
        width: 48px;
        height: 48px;
        align-self: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .volume-slider {
        width: 80px;
    }
    
    .audio-section h3,
    .emotion-section h3,
    .info-section h3 {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 480px) {
    .audio-player {
        padding: var(--space-sm);
    }
    
    .play-btn {
        width: 44px;
        height: 44px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .time-display {
        font-size: 0.7rem;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .info-item {
        padding: var(--space-md);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .play-btn {
        width: 56px;
        height: 56px;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    #progress-slider {
        height: 32px;
        top: -12px;
    }
    
    .volume-btn {
        padding: var(--space-sm);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .audio-player,
    .emotion-bar-fill,
    .info-item {
        transition: none !important;
    }
    
    .emotion-bar-fill::before {
        animation: none !important;
    }
}



/* ======================================== */
/* WIKIPEDIA LINK */
/* ======================================== */

.wikipedia-link-container {
    margin-top: var(--space-lg);
    animation: fadeIn 0.6s var(--ease-standard);
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

.wikipedia-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.wikipedia-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(33, 128, 141, 0.1), transparent);
    transition: left 0.5s ease;
}

.wikipedia-link:hover::before {
    left: 100%;
}

.wikipedia-link:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
}

.wikipedia-link:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.wikipedia-icon {
    color: var(--color-primary);
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.wikipedia-link:hover .wikipedia-icon {
    transform: scale(1.1) rotate(5deg);
}

.wikipedia-text {
    flex: 1;
    letter-spacing: 0.02em;
}

.external-icon {
    color: var(--color-text-light);
    flex-shrink: 0;
    transition: all var(--transition-base);
    opacity: 0.7;
}

.wikipedia-link:hover .external-icon {
    opacity: 1;
    transform: translate(2px, -2px);
    color: var(--color-primary);
}

/* ======================================== */
/* RESPONSIVE - WIKIPEDIA LINK */
/* ======================================== */

@media (max-width: 768px) {
    .wikipedia-link {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-xs);
    }
    
    .wikipedia-icon {
        width: 18px;
        height: 18px;
    }
    
    .external-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .wikipedia-link-container {
        margin-top: var(--space-md);
    }
    
    .wikipedia-link {
        width: 100%;
        justify-content: center;
        padding: var(--space-md);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .wikipedia-link {
        padding: var(--space-md) var(--space-lg);
        min-height: 44px; /* Better touch target */
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wikipedia-link,
    .wikipedia-icon,
    .external-icon {
        transition: none !important;
    }
    
    .wikipedia-link::before {
        display: none;
    }
}

/* Dark mode support (if you add it later) */
@media (prefers-color-scheme: dark) {
    .wikipedia-link {
        background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
        border-color: #444;
        color: #e0e0e0;
    }
    
    .wikipedia-link:hover {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a3a4a 100%);
        border-color: var(--color-primary);
    }
}