/* Variables - Colores Santeños */
:root {
    --primary: #e85d04;
    --primary-dark: #d00000;
    --primary-light: #ff6b35;
    --secondary: #ffba08;
    --background: #fef9f3;
    --surface: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #666666;
    --success: #2ecc71;
    --shadow: 0 4px 20px rgba(232, 93, 4, 0.15);
    --shadow-lg: 0 8px 40px rgba(208, 0, 0, 0.2);
    --radius: 16px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding-bottom: 2rem;
}

/* Header */
.header {
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    color: white;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: white;
    padding: 4px;
}

.station-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.frequency {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.slogan {
    font-size: 1rem;
    opacity: 0.85;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Player Section */
.player-section {
    padding: 0 1rem;
    margin-top: -0.5rem;
}

.player-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

/* Live Indicator */
.now-playing {
    margin-bottom: 1.5rem;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Play Button */
.player-controls {
    margin: 1.5rem 0;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(26, 95, 180, 0.4);
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(26, 95, 180, 0.5);
}

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

.play-btn svg {
    width: 36px;
    height: 36px;
}

.play-btn.playing {
    background: linear-gradient(135deg, var(--success), #27ae60);
    animation: pulse-shadow 2s ease-in-out infinite;
}

@keyframes pulse-shadow {
    0%, 100% { box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(46, 204, 113, 0.6); }
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    padding: 0 1rem;
}

.volume-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Status Text */
.status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.status-text.playing {
    color: var(--success);
    font-weight: 500;
}

.status-text.error {
    color: #e74c3c;
}

/* Instagram Section */
.instagram-section {
    padding: 2rem 1rem;
    background: var(--background);
    margin-top: 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.instagram-icon {
    width: 28px;
    height: 28px;
    color: #e4405f;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.instagram-feed {
    margin-bottom: 1rem;
}

.instagram-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.instagram-follow-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.instagram-follow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(131, 58, 180, 0.4);
}

/* Instagram Profile Card */
.instagram-profile-card {
    display: block;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.instagram-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.instagram-profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.instagram-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instagram-avatar svg {
    width: 30px;
    height: 30px;
    color: white;
}

.instagram-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.instagram-username {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.instagram-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.instagram-external-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.instagram-external-icon svg {
    width: 100%;
    height: 100%;
}

.instagram-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.instagram-cta .instagram-logo {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--background);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-slogan {
    font-style: italic;
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.3s ease;
}

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

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 95, 180, 0.4);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-secondary:hover {
    color: var(--text-primary);
}

.install-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.install-instructions.hidden {
    display: none;
}

.share-icon {
    display: inline-block;
    transform: rotate(180deg);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: calc(100% - 2rem);
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast span {
    font-size: 0.85rem;
}

.toast button {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.toast-close {
    background: transparent !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 1.2rem !important;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 380px) {
    .header {
        padding: 1.5rem 1rem 1rem;
    }

    .logo-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .station-info h1 {
        font-size: 1.3rem;
    }

    .play-btn {
        width: 70px;
        height: 70px;
    }

    .play-btn svg {
        width: 32px;
        height: 32px;
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 1rem;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .station-info h1 {
        font-size: 1.2rem;
    }

    .player-card {
        padding: 1rem;
    }

    .play-btn {
        width: 60px;
        height: 60px;
    }
}

/* PWA Standalone mode adjustments */
@media (display-mode: standalone) {
    .app-container {
        padding-top: env(safe-area-inset-top);
    }
}
