/* Reset default styles for the widget's scope */
.radio-status-container div,
.radio-status-container p,
.radio-status-container h1,
.radio-status-container a,
.radio-status-container img,
.radio-status-container audio {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.radio-status-container {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
}

.radio-status-container .content-wrapper {
    display: flex;
}

.radio-status-container .left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
    flex-shrink: 0;
}

.radio-status-container .show-image {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
}

.radio-status-container .show-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#no-cover-message {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #333;
    font-size: 18px;
    font-weight: bold;
    color: #888;
}

#album-cover-container {
    width: 150px;
    height: 150px;
    margin-top: 10px;
}

#album-cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-status-container .on-air-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff0000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
}

/* --- Layouts --- */
/* Compact Layout */
.layout-compact .left-panel {
    display: none; /* Hide the entire left panel */
}
.layout-compact .show-info {
    padding: 15px; /* Reduce padding */
}
.layout-compact .show-name {
    font-size: 20px; /* Smaller show name */
}

/* Horizontal Layout */
.layout-horizontal .content-wrapper {
    flex-direction: row;
    align-items: stretch; /* Make panels equal height */
}
.layout-horizontal .left-panel {
    width: auto; /* Let it shrink to fit content */
    flex-direction: row; /* Align images side-by-side */
    justify-content: flex-start;
    align-items: center;
    padding: 10px;
}
/* --- Player Style Specific Rules --- */

/* Hide stop button by default */
#stop-button {
    display: none;
}

/* --- Multi-Button Style --- */
.player-style-multi-button #stop-button {
    display: flex; /* Show the stop button */
    background-color: #d9534f; /* Red */
}
.player-style-multi-button #stop-button:hover {
    background-color: #c9302c;
}

.player-style-multi-button #play-pause-button {
    background-color: #5cb85c; /* Green for play */
}
.player-style-multi-button #play-pause-button:hover {
    background-color: #4cae4c;
}
.player-style-multi-button #play-pause-button.is-playing {
    background-color: #f0ad4e; /* Orange for pause */
}
.player-style-multi-button #play-pause-button.is-playing:hover {
    background-color: #ec971f;
}


/* --- Round Player Style --- */
.player-style-round .audio-player-container {
    position: relative;
    width: 150px; /* Same as album art */
    height: 150px;
    margin: 20px auto;
}

.player-style-round .player-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-style-round .audio-player-container:hover .player-controls {
    opacity: 1;
}

.player-style-round #play-pause-button {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.player-style-round .volume-container {
    position: absolute;
    bottom: -30px; /* Position it below the circle */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
}

.player-style-round .show-image {
    display: none; /* Hide the default DJ image for the round player */
}
.player-style-round .left-panel #album-cover-container {
    border-radius: 50%;
    overflow: hidden;
    width: 150px; /* Ensure container has a size */
    height: 150px;
}
.player-style-round .left-panel #album-cover-image {
    border-radius: 50%;
}
.layout-horizontal .show-image,
.layout-horizontal #album-cover-container {
    width: 100px; /* Fixed size for predictability */
    height: 100px;
    margin-top: 0; /* Override default margin */
    margin-right: 10px; /* Space between images */
}
.layout-horizontal .show-info {
    padding: 10px;
    text-align: left;
    justify-content: center;
    flex-grow: 1; /* Allow info to take remaining space */
}
.layout-horizontal .show-name {
    font-size: 18px; /* Smaller font for show name */
}
.layout-horizontal .song-title {
    font-size: 16px; /* Smaller font for song title */
}

.radio-status-container .show-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1; /* Allow this panel to take up remaining space */
    min-width: 0; /* Prevents overflow with long text */
}

.radio-status-container .show-name {
    margin-top: 0;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.radio-status-container .live-show-details {
    margin-top: 10px;
}

.radio-status-container .show-time-label,
.radio-status-container .show-motto-label {
    font-size: 16px;
    font-weight: bold;
    color: #ffc107;
    margin-top: 5px;
}

.radio-status-container .show-time {
    font-size: 14px;
    color: #ccc;
    margin: 2px 0 10px 0;
}

.radio-status-container .show-motto {
    font-size: 14px;
    color: #ccc;
    margin: 2px 0;
    font-style: italic;
}

.radio-status-container .song-title-label {
    font-size: 16px;
    font-weight: bold;
    color: #ffc107;
    margin-top: 15px;
    margin-bottom: 5px;
}

.radio-status-container .song-title-marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.radio-status-container .song-title {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
    font-size: 18px;
}

.radio-status-container .dj-name {
    font-size: 16px;
    margin-top: 15px;
}

.listener-count-container {
    font-size: 14px;
    margin-top: 10px;
    text-align: right;
    font-weight: bold;
}

.radio-status-container .audio-player-container {
    margin-top: 20px; /* Increased margin for better spacing */
}

/* Hide the default audio player */
.radio-status-container #audio-player {
    display: none;
}

.radio-status-container .player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
}

.radio-status-container .control-button {
    background: none;
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

.radio-status-container .control-button:hover {
    background-color: #fff;
    color: #333;
}

.radio-status-container .volume-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 10px;
}

.radio-status-container .volume-container i {
    font-size: 18px;
}

.radio-status-container #volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #555;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
}

.radio-status-container #volume-slider:hover {
    opacity: 1;
}

.radio-status-container #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ffc107;
    cursor: pointer;
    border-radius: 50%;
}

.radio-status-container #volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ffc107;
    cursor: pointer;
    border-radius: 50%;
}

/* Custom Audio Player Styles */
.radio-status-container audio::-webkit-media-controls-panel {
    background-color: #333;
}
.radio-status-container audio::-webkit-media-controls-play-button,
.radio-status-container audio::-webkit-media-controls-mute-button {
    background-color: #ffc107;
    border-radius: 50%;
}
.radio-status-container audio::-webkit-media-controls-timeline {
    background-color: #555;
    border-radius: 2px;
}
.radio-status-container audio::-webkit-media-controls-current-time-display,
.radio-status-container audio::-webkit-media-controls-time-remaining-display {
    color: #fff;
}

/* Marquee Animation */
@keyframes marquee {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Button Styles */
.radio-status-container .buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 10px; /* Add space between buttons */
    margin-top: 15px;
}

.radio-status-container .button {
    flex-grow: 1; /* Make buttons share the space equally */
    padding: 10px; /* Increase padding for better touch targets */
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.radio-status-container .button:hover {
    opacity: 0.9;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    height: 70%;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-content iframe {
    width: 100%;
    height: 100%; /* Fill the container */
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Player Modal Specific Styles */
#player-modal .modal-content {
    height: auto; /* Auto height based on content */
    max-width: 500px;
    text-align: center;
}

.player-links-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.player-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-link-label {
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.player-link-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #808080; /* Gray background */
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s;
    width: 80px; /* Fixed width */
    height: 80px; /* Fixed height */
}

.player-link-button:hover {
    background-color: #555;
}

.player-link-button i,
.player-link-button img {
    font-size: 24px;
    margin-bottom: 8px;
    height: 24px; /* Ensure images and icons are the same height */
}

.player-link-button span {
    font-size: 14px;
    font-weight: bold;
}

/* --- Image Position Logic --- */
/* For right-aligned images, reverse the order of the panels */
.image-position-right .content-wrapper {
    flex-direction: row-reverse;
}

/* For center-aligned images, stack them vertically and center everything */
.image-position-center .content-wrapper {
    flex-direction: column;
}

.image-position-center .left-panel {
    flex-direction: row; /* Align DJ and Album art side-by-side */
    justify-content: center;
    margin-bottom: 20px;
    width: 100%; /* Take full width to center content */
}

.image-position-center .show-info {
    text-align: center;
}

.image-position-center .buttons-container {
    justify-content: center; /* Center the buttons */
}
