/* ==========================================================================
   Global Styles
   ========================================================================== */

/* Apply box-sizing to all elements for consistent padding and border calculations */
* {
    box-sizing: border-box;
}

/* Set base styles for body and html to remove default margins, set full height, and define typography */
body,
html {
    margin: 0;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: #111;
    color: #fff;
    overflow-x: hidden;
}

/* ==========================================================================
   Light theme
   ========================================================================== */

body.light {
    background-color: #eeeeee;
    color: #333333;
}

body.light .side-nav,
body.light .floating-component,
body.light .help-content {
    background-color: #f0f0f0;
    color: #333333;
}

body.light .donate-button,
body.light .help-button,
body.light .discovery-button,
body.light .center-button {
    background-color: #ffffff;
    color: #1ED760;
}

body.light .donate-button:hover,
body.light .help-button:hover,
body.light .discovery-button:hover,
body.light .center-button:hover {
    background-color: rgba(224, 224, 224, 0.2);
}

body.light .modal-content {
    background-color: #E0E0E0;
}

body.light .radio-search-input {
    background: #E0E0E0;
    color: #000000;
}

body.light p {
    color: #555;
}

body.light .menu-toggle {
    color: #555;
}

body.light .menu-toggle {
    background-color: #e0e0e0;
    color: #333333;
}

body.light .tag {
    background-color: #d0d0d0;
    color: #333333;
}

body.light .favorite-clear-btn {
    background: #B3B2B2;
}

body.light .status-indicator.online .status-dot {
    background-color: #28a745;
}

body.light .status-indicator.offline .status-dot {
    background-color: #dc3545;
}

body.light .station-links {
    border-top: 1px solid #D2D2D2;
    background-color: #F0F0F0;
}

body.light .station-link {
    background-color: #E0E0E0;
}

body.light .station-link-limonada {
    background-color: #E0E0E0;
    color: #000000;
}

body.light .menu-item.selected .menu-toggle {
    background-color: #b3b2b2;
}

body.light .radio-player-container {
    background: #E0E0E0;
    border-bottom: 1px solid #D2D2D2;
}

body.light .tags-container {
    border-bottom: 1px solid #D2D2D2;
}

body.light .station-header {
    background: #F0F0F0;
    border-bottom: 1px solid #D2D2D2;
}

body.light .station-logo {
    border: 1px solid #D2D2D2;
}

body.light .input-range {
    background: #fff;
    box-shadow: inset 0 0 4px #fff;
}

/* ==========================================================================
   Map Styles
   ========================================================================== */

/* Define the full-screen map container */
#map {
    width: 100%;
    height: 100%;
}

/* Customize MapLibre GL popup content background and border */
.maplibregl-popup-content {
    background-color: #111 !important;
    border-radius: 8px !important;
}

/* Customize MapLibre GL popup tip color to match the content background */
.maplibregl-popup-tip {
    border-top-color: #111 !important;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

/* Style for the help button with fixed position and circular design */
.help-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: #0E0E0E;
    color: #1ED760;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

/* Hover effect for the help button to change background opacity */
.help-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Style for the discovery button with fixed position and circular design */
.discovery-button {
    position: fixed;
    bottom: 120px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: #0E0E0E;
    color: #1ED760;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

/* Hover effect for the help button to change background opacity */
.discovery-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Style for the discovery button with fixed position and circular design */
.center-button {
    position: fixed;
    bottom: 70px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: #0E0E0E;
    color: #1ED760;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

/* Hover effect for the help button to change background opacity */
.center-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Style for the donate button with fixed position and circular design */
.donate-button {
    position: fixed;
    bottom: 170px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: #0E0E0E;
    color: #1ED760;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Donate button icon */
.donate-button i {
    animation: pulse 3.5s ease-in-out infinite;
}

/* Pulse animation for donate-button */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Hover effect for the donate button to change background opacity */
.donate-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Style for the Stripe donation button with a green theme */
.donate-stripe-btn {
    background-color: #00cc66;
    color: #1a1c20;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    margin-top: 20px;
}

/* Hover effect for the Stripe donation button to darken the background */
.donate-stripe-btn:hover {
    background-color: #00b359;
}

/* Style for the Nubank donation button with a purple theme */
.donate-nubank-btn {
    background-color: #820AD1;
    color: #1a1c20;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    margin-top: 20px;
}

/* Hover effect for the Nubank donation button to darken the background */
.donate-nubank-btn:hover {
    background-color: #7509bd;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

/* Base style for the modal overlay with full-screen coverage */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    overflow: auto;
}

/* Style for the modal content box with centered layout */
.modal-content {
    background-color: #1a1c20;
    margin: 15% auto;
    padding: 15px;
    border-radius: 12px;
    width: 85%;
    max-width: 400px;
    color: #fff;
    position: relative;
    text-align: center;
}

/* Style for the modal header with centered alignment */
.modal-header {
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Style for the heart icon within the modal header */
.heart-icon {
    width: 20px;
    height: 20px;
    color: #00ff66;
    font-size: 40px;
}

/* Style for the menu container icon size */
.menu-container-icon {
    font-size: 15px;
}

/* Style for the favorite icon within the menu container */
.menu-container-favorite {
    font-size: 25px;
}

/* Style for the favorited state of the favorite icon */
.menu-container-favorite.favorited {
    color: red;
}

/* Style for the not-favorited state of the favorite icon */
.menu-container-favorite.not-favorited {
    color: gray;
}

/* Style for heading level 2 within the modal */
h2 {
    font-size: 18px;
    margin: 0;
    color: #00ff66;
}

/* Style for paragraph text within the modal */
p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
    color: #ccc;
}

/* Style for the modal footer text */
.modal-footer {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
}

/* Style for the close button in the modal */
.close-modal {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

/* Hover effect for the close button to change color */
.close-modal:hover {
    color: #fff;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */

/* Style for the help content text color */
.help-content {
    color: #fff;
}

/* Style for the app header text color */
.app-header {
    color: #1ED760;
}

/* Style for the menu container with padding */
.menu-container {
    padding: 0 10px;
}

/* Style for each menu item with spacing */
.menu-item {
    margin-bottom: 5px;
    position: relative;
}

/* Style for the menu toggle button with flex layout */
.menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 13px;
    width: 100%;
    text-align: left;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

/* Hover effect for the menu toggle to add a light background */
.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Style for the selected menu item toggle */
.menu-item.selected .menu-toggle {
    background-color: #2a2d32;
    color: #fff;
}

/* Style for the chevron icon with transition */
.chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

/* Style for the submenu container */
.submenu {
    padding: 5px 10px;
    margin-top: 5px;
}

/* Style for submenu items and content */
.submenu-item,
.submenu-content {
    color: #aaa;
    font-size: 12px;
}

/* Style for unordered lists within submenu content */
.submenu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Style for list items within submenu content */
.submenu-content ul li {
    padding: 5px 0;
}

/* Style for buttons within submenu content */
.favorite-clear-btn {
    margin-top: 10px;
    background: #333;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* Style for buttons within submenu content */
.last-stations-clear-btn {
    margin-top: 10px;
    background: #333;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* Hover effect for submenu buttons */
.favorite-clear-btn:hover {
    background: #444;
}

/* ==========================================================================
   Component Styles
   ========================================================================== */

/* Base style for the input */

input {
    accent-color: #1ED760;
}

/* Base style for the side navigation panel */
.side-nav {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 80%;
    max-width: 320px;
    height: calc(100% - 20px);
    background: rgba(16, 17, 18, 0.6);
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Base style for the floating component */
.floating-component {
    position: fixed;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%) translateY(0) !important;
    background-color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 25rem;
    max-width: 25rem;
}

/* Base style for the close button */
.close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 10;
    transition: color 0.2s;
}

/* Hover effect for the close button */
.close-btn:hover {
    color: #fff;
}

/* Style for the minimize button */
.minimize-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 32px;
    z-index: 10;
    transition: color 0.2s;
}

/* Hover effect for the minimize button */
.minimize-btn:hover {
    color: #fff;
}

/* Style for the restore button */
.restore-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 32px;
    z-index: 10;
    transition: color 0.2s;
}

/* Hover effect for the restore button */
.restore-btn:hover {
    color: #fff;
}

/* Style for shifted state of side navigation */
.side-nav.shifted {
    transform: translateX(-335px) !important;
}

/* Style for the station header section */
.station-header {
    padding: 15px;
    background: linear-gradient(to bottom, #0E0E0E, #101112);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #333;
    border-radius: 10px 10px 0px 0px;
}

/* Style for the station logo image */
.station-logo {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid #333;
}

/* Style for the station logo placeholder */
.station-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #222;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
}

/* Style for the station info section */
.station-info {
    flex: 1;
}

/* Style for headings within station info */
.station-info h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.2;
    max-width: 160px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Style for the favorite button */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

/* Style for SVG within the favorite button */
.favorite-btn svg {
    width: 18px;
    height: 18px;
    stroke: #40010f;
    fill: #40010f;
}

/* Style for favorited state of the favorite button SVG */
.favorite-btn[aria-pressed="true"] svg {
    fill: #db0000;
    stroke: #db0000;
}

/* Style for the status indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    opacity: 0.8;
}

/* Style for the status dot */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* Style for online status dot */
.online .status-dot {
    background-color: #1ED760;
    box-shadow: 0 0 4px #1ED760;
}

/* Style for offline status dot */
.offline .status-dot {
    background-color: #f87171;
}

/* Style for online status text */
.online .status-text {
    color: #1ED760;
}

/* Style for offline status text */
.offline .status-text {
    color: #f87171;
}

/* Style for the tags container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
}

/* Style for individual tags */
.tag {
    background: #333;
    color: #ddd;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 10px;
    text-transform: lowercase;
}

/* Style for the radio player container */
.radio-player-container {
    padding: 10px 15px;
    background: #222;
    border-bottom: 1px solid #333;
}

/* Style for the radio player layout */
.radio-player {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style for the radio player search input */
.radio-search-input {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border-radius: 6px;
    border: none;
    background: #222;
    color: #fff;
}

/* Style for player controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style for player buttons */
.player-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1ED760;
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
    transition: all 0.2s;
}

/* Hover effect for player buttons */
.player-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.5);
}

/* Style for SVG within player buttons */
.player-btn svg {
    width: 20px;
    height: 20px;
}

/* Style for player info section */
.player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Style for player info in floating component */
.player-info-floating {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

/* Style for the "now playing" text */
.now-playing {
    font-size: 10px;
    color: #1ED760;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Style for the input range slider */
.input-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #111;
    outline: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 1);
}

/* Style for the slider thumb */
.input-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: -407px 0 0 400px #1ED760;
    z-index: 1000;
}

/* Style for the station name */
.station-name {
    font-size: 12px;
    font-weight: 500;
}

/* Style for the station details section */
.station-details {
    padding: 10px 15px;
}

/* Style for headings in station details */
.station-details h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #aaa;
    font-weight: 500;
}

/* Style for info items */
.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Style for info icons */
.info-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* Style for info content */
.info-content {
    flex: 1;
}

/* Style for info labels */
.info-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}

/* Style for info values */
.info-value {
    font-size: 12px;
    font-weight: 500;
}

/* Style for station links section */
.station-links {
    padding: 10px 15px;
    border-top: 1px solid #333;
    margin-top: auto;
    display: flex;
}

/* Style for general station links */
.station-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1ED760;
    text-decoration: none;
    padding: 8px;
    border-radius: 4px;
    background: #222;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
}

/* Style for Limonada-specific station link */
.station-link-limonada {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FFE88E;
    text-decoration: none;
    padding: 8px;
    border-radius: 4px;
    background: #222;
    font-size: 12px;
    transition: all 0.2s;
    width: 100%;
}

/* Hover effect for station links */
.station-link:hover {
    background: #2a2a2a;
}

/* Customize audio controls panel background */
audio::-webkit-media-controls-panel {
    background-color: #444;
}

/* Customize audio time display text color */
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-current-time-display {
    color: #fff;
}

/* ==========================================================================
   Animation Styles
   ========================================================================== */

/* Ensure the slide-out animation respects the shifted state */
.side-nav {
    animation: fadeSlideIn 0.3s ease-out forwards;
}

.side-nav.closing {
    animation: fadeSlideOut 0.3s ease-in forwards;
}

/* Fade and slide-in animation for floatingContainer (from the bottom) */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Fade and slide-out animation for floatingContainer (from the bottom) */
@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

/* Fade aonly animation for floatingContainer (from the bottom) */
@keyframes fadeOnly {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Base style for floating component with animation */
.floating-component {
    animation: fadeSlideIn 0.3s ease-out forwards;
}

/* Animation for sliding out the floating component */
.floating-component.slide-out {
    animation: fadeSlideOut 0.3s ease-out forwards;
}

/* ==========================================================================
   Media Query Styles
   ========================================================================== */

/* Responsive adjustments for screens up to 768px */
@media (max-width: 768px) {
    .help-button {
        bottom: 15px;
        left: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .donate-button {
        bottom: 150px;
        left: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .discovery-button {
        bottom: 105px;
        left: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .center-button {
        bottom: 60px;
        left: 15px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .side-nav {
        width: 90%;
        max-width: 280px;
        top: 10px;
        right: 10px;
        height: calc(100% - 20px);
    }

    .side-nav.shifted {
        transform: translateX(-295px) !important;
    }

    .station-logo,
    .station-logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .player-btn {
        width: 30px;
        height: 30px;
    }

    .player-btn svg {
        width: 16px;
        height: 16px;
    }

    .modal-content {
        margin: 20% auto;
        padding: 10px;
        width: 90%;
    }

    .modal-header {
        gap: 6px;
    }

    .heart-icon {
        width: 18px;
        height: 18px;
    }

    h2 {
        font-size: 16px;
    }

    p {
        font-size: 12px;
    }

    .modal-footer {
        font-size: 10px;
    }

    .close-modal {
        top: 6px;
        right: 10px;
        font-size: 18px;
    }
}

/* Responsive adjustments for screens up to 480px */
@media (max-width: 480px) {
    .help-button {
        top: 10px;
        left: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .center-button {
        top: 50px;
        left: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .discovery-button {
        top: 90px;
        left: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .donate-button {
        top: 130px;
        left: 10px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .side-nav {
        width: 95%;
        max-width: 250px;
    }

    .side-nav.shifted {
        transform: translateX(-265px) !important;
    }

    .station-info h3 {
        max-width: 120px;
        font-size: 12px;
    }

    .player-controls {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .player-info {
        text-align: center;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}