body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background:
        linear-gradient(rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35)),
        url('img/portada.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-attachment: scroll;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
}

.top-section {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.center-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.horizontal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.horizontal-title span {
    animation: fadeIn 1s ease-out;
}

.horizontal-title span:first-child {
    font-weight: normal;
}

.horizontal-title span:last-child {
    font-weight: bold;
}

h1 {
    font-weight: bold;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    position: fixed;
    bottom: calc(6rem - 4px);
    left: 2rem;
    width: auto;
    padding: 0;
    align-self: flex-start;
    visibility: visible !important;
}

.social-links .social-icon {
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
    visibility: visible !important;
}

.social-links .social-icon i {
    visibility: visible !important;
}

.social-icon:hover {
  transform: scale(1.2) rotate(5deg);
  color: #ef4444;
}

.social-links .social-icon:last-child i[data-lucide="message-circle"] {
    color: #25D366; /* WhatsApp green */
}

.player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.station-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.station-info img {
    width: 48px;
    height: 48px;
    border-radius: 0.25rem;
}

.station-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.live-indicator {
    font-size: 0.875rem;
    color: #ef4444;
    animation: pulse 1.5s infinite;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.live-indicator.alternative {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 1rem;
    padding: 0.35rem 0.75rem;
    gap: 0.4rem;
    position: relative;
    animation: live-glow 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.live-indicator.alternative .live-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

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

@keyframes live-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2), 0 0 0 0 rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4), 0 0 20px rgba(239, 68, 68, 0.3);
        border-color: rgba(239, 68, 68, 0.5);
    }
}

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

.playback-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.playback-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #3B82F6; /* Primary blue color */
    transition: color 0.3s ease, transform 0.3s ease;
}

.playback-controls button:hover {
    color: #8B5CF6; /* A complementary purple color */
    transform: scale(1.1);
}

#playPauseButton {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#playPauseButton:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(59, 130, 246, 0.4);
}

.extra-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#likeButton {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444; /* Always red heart */
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#volumePercentage {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 40px;
    text-align: right;
}

#volumeSlider {
    width: 80px;
}

.player-controls .station-info {
    flex: 1;
}

.player-controls .extra-controls {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.liked {
    color: #ef4444;
    fill: #ef4444;
}

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

@keyframes backgroundMovement {
  0%, 100% {
    background-size: 100% 100%;
  }
  50% {
    background-size: 110% 110%;
  }
}

/* Styles for the song title */
.song-title {
    margin-top: 2rem;
    height: auto; /* Allow height to adjust */
    min-height: 1.5rem; /* Ensure minimum height */
    display: block; /* Change to block to handle wrapping text */
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem; /* Base font size */
    text-align: center;
    max-width: 80%;
    margin-left: auto; /* Center the block element */
    margin-right: auto; /* Center the block element */
    overflow: visible; /* Allow content to overflow if necessary (though with wrapping it shouldn't) */
    text-overflow: clip; /* Reset text-overflow */
    white-space: normal; /* Allow text to wrap */
    word-break: break-word; /* Break long words if necessary */
    transition: opacity 0.3s ease, font-size 0.3s ease; /* Add a transition for updates and font size */
}

/* Style for long titles */
.song-title.long-title {
    font-size: 1rem; /* Smaller font size for long titles */
}

.song-title.title-update {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app-download-buttons {
    position: fixed;
    bottom: 5.2rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.download-button {
    display: flex;
    align-items: center;
    background-color: white;
    color: black;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

.download-button:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.download-button i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.download-button .button-text {
    display: flex;
    flex-direction: column;
}

.download-button small {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1;
}

.download-button span {
    font-weight: bold;
    font-size: 0.9rem;
    line-height: 1;
}

.play-store i {
    color: #2196F3;
}

.app-store i {
    color: #333;
}

.current-date-time {
    position: absolute;
    text-align: right;
    color: white;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.current-date-time-left {
    top: 1rem;
    left: 1rem;
    right: auto;
    text-align: left;
}

.share-button {
    position: relative;
}

.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.share-modal {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.share-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.share-overlay.visible .share-modal {
    transform: scale(1);
    opacity: 1;
}

.share-modal h2 {
    margin-bottom: 1rem;
    color: #3B82F6;
}

.share-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.share-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
    padding: 1rem;
    border-radius: 0.5rem;
}

.share-links a:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.05);
}

.share-links a i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.share-links .bi-whatsapp {
    color: #25D366;
}

.share-links .bi-facebook {
    color: #1877F2;
}

.share-links .bi-twitter {
    color: #1DA1F2;
}

.share-modal .close-button {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.share-modal .close-button:hover {
    transform: rotate(90deg);
}

/* Chat container styles are mostly in chat-styles.css */


@media (max-width: 768px) {
    body {
        background-size: cover;
        background-position: center center;
        background-attachment: scroll;
    }
    .app-download-buttons {
        position: static; /* Changed from fixed */
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 1rem;
        bottom: auto;
        right: auto;
    }

    .download-button {
        padding: 0.3rem 0.6rem;
    }

    .download-button i {
        font-size: 1.2rem;
        margin-right: 0.3rem;
    }

    .download-button small {
        font-size: 0.5rem;
    }

    .download-button span {
        font-size: 0.7rem;
    }

    .player-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        gap: 1rem;
    }

    .station-info {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        flex: 1;
    }

    .station-info img {
        margin-bottom: 0;
    }

    .playback-controls {
        order: 0;
        flex: 1;
        justify-content: center;
    }

    .extra-controls {
        order: 0;
        flex: 1;
        justify-content: flex-end;
    }

    .player-controls .station-info,
    .player-controls .extra-controls {
        flex: 1;
    }

    /* Mobile volume control adjustments moved to mobile-adjustments.css */


    .social-links {
        position: fixed;
        bottom: calc(6rem - 4px);
        left: 2rem;
        width: auto;
        display: flex;
        gap: 1rem;
        z-index: 20;
    }

    .social-icon {
        color: white;
        opacity: 1;
    }

    /* Song title adjustments for mobile */
    .song-title {
        font-size: 1rem; /* Base font size on mobile */
    }

    .song-title.long-title {
        font-size: 0.9rem; /* Smaller font size for long titles on mobile */
    }
}

@media (max-width: 480px) {
    .player-controls {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .station-info {
        gap: 0.5rem;
    }

    .station-info img {
        width: 36px;
        height: 36px;
    }

    .station-name {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 110px;
    }

    .live-indicator {
        font-size: 0.7rem;
    }

    .playback-controls button {
        padding: 0.2rem;
    }

    #playPauseButton {
        width: 2.5rem;
        height: 2.5rem;
    }

    /* Mobile volume control adjustments moved to mobile-adjustments.css */


    .app-download-buttons {
        flex-direction: row;
        bottom: 5rem; /* This rule is now effectively static */
        right: 0.5rem; /* This rule is now effectively static */
        gap: 0.5rem;
        position: static; /* Ensure it stays static */
        margin-top: 0.5rem; /* Add some space after the center content */
    }

    .download-button {
        flex-direction: row;
        align-items: center;
        padding: 0.3rem 0.6rem;
        gap: 0.5rem;
    }

    .download-button i {
        font-size: 1.2rem;
        margin-right: 0.3rem;
    }

    .download-button .button-text {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-button small {
        font-size: 0.5rem;
    }

    .download-button span {
        font-size: 0.7rem;
    }

    .social-links {
        position: fixed;
        bottom: calc(5rem - 4px);
        left: 1rem;
        gap: 0.75rem;
        display: flex !important;
        opacity: 1 !important;
        width: auto;
        z-index: 20;
        visibility: visible !important;
    }

    .social-links .social-icon {
        transform: scale(1);
        color: white !important;
        opacity: 1 !important;
        display: flex !important;
        align-items: center;
    }

    .social-links .social-icon i {
        color: white !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
    }

    .current-date-time-left {
        top: 0.5rem;
        left: 0.5rem;
        font-size: 0.8rem;
    }

    /* Song title adjustments for smaller mobile */
     .song-title {
        font-size: 0.9rem; /* Base font size on smaller mobile */
    }
    .song-title.long-title {
        font-size: 0.8rem; /* Smaller font size for long titles on smaller mobile */
    }
}

@media (max-width: 360px) {
    .app-download-buttons {
        gap: 0.4rem; /* Slightly reduce gap */
    }

    .download-button {
        padding: 0.25rem 0.5rem; /* Slightly reduce padding */
    }

    .download-button i {
        font-size: 1.1rem; /* Slightly reduce icon size */
        margin-right: 0.2rem;
    }

    .download-button small {
        font-size: 0.45rem; /* Slightly reduce small text */
    }

    .download-button span {
        font-size: 0.65rem; /* Slightly reduce span text */
    }

    /* Song title adjustments for very small mobile */
    .song-title {
       font-size: 0.8rem; /* Base font size on very small mobile */
   }
   .song-title.long-title {
       font-size: 0.7rem; /* Smaller font size for long titles on very small mobile */
   }
}

@media (max-width: 768px) {
    /* Chat button and container position adjustments are now handled
       in chat-button-style.css and chat-styles.css */
}


/* Dark mode adjustments */
body.dark-mode {
    background:
        linear-gradient(rgba(31, 41, 55, 0.35), rgba(17, 24, 39, 0.35)),
        url('img/portada.png') no-repeat center center fixed;
    background-size: cover;
    color: #e5e7eb;
}

body.dark-mode .player-controls {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .station-name {
    color: #ffffff;
}

body.dark-mode .live-indicator {
    color: #ef4444;
}

body.dark-mode .volume-control i,
body.dark-mode .playback-controls i {
    color: #e5e7eb;
}

body.dark-mode #volumePercentage {
    color: #9ca3af;
}

body.dark-mode .social-icon {
    color: #e5e7eb;
}

body.dark-mode .download-button {
    background-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .download-button i.bi-apple,
body.dark-mode .download-button i.bi-google-play {
    color: white;
}

body.dark-mode .social-links .social-icon,
body.dark-mode .social-links .social-icon i {
    color: #e5e7eb !important;
    opacity: 1 !important;
}

body.dark-mode .playback-controls button {
    color: #93C5FD;
}

body.dark-mode .playback-controls button:hover {
    color: #A78BFA;
}

body.dark-mode .chat-container {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .chat-input {
    border-top: 1px solid #374151;
}

body.dark-mode .chat-input input {
    background-color: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

body.dark-mode .message.received {
    background-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .song-title {
    color: #e5e7eb; /* Adjust color for dark mode */
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    z-index: 50;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

body.dark-mode .theme-toggle {
    color: #f3f4f6;
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* iOS PWA specific styles */
.ios-standalone {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.ios-standalone .container {
  padding-top: calc(2rem + env(safe-area-inset-top));
}

.ios-standalone .current-date-time-left {
  top: calc(1rem + env(safe-area-inset-top));
}

.ios-standalone .theme-toggle {
  top: calc(1rem + env(safe-area-inset-top));
}

/* Prevent iOS zoom on form elements */
input[type="range"] {
  font-size: 16px;
}

/* iOS specific touch improvements */
button, .social-icon, .download-button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}