@font-face {
    font-family: 'Vazirr';
    src: url('/Vazirr.woff2');
}

/* CSS Variables for Light Mode (Default) */
:root {
    --bg-primary: #0d372e;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-chat: rgba(255, 255, 255, 0.05);
    --bg-message: rgba(255, 186, 37, 0.08);
    --bg-input: #0d372e;
    --bg-select: #ab0004;
    --bg-select-hover: #8b0003;
    --bg-button-hover: #ffba25;
    --bg-cooldown: rgba(171, 0, 4, 0.3);
    --bg-scrollbar-track: rgba(255, 255, 255, 0.05);
    --bg-message-hover: rgba(255, 186, 37, 0.15);
    --bg-chat-input-focus: rgba(255, 186, 37, 0.05);
    --bg-system-message: rgba(255, 186, 37, 0.1);
    --bg-black-overlay: rgba(0, 0, 0, 0.2);
    --bg-black-overlay-2: rgba(0, 0, 0, 0.3);
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-accent: #ffba25;
    --text-red: #ab0004;
    --border-primary: #ffba25;
    --border-secondary: #ab0004;
    --border-message: rgba(255, 186, 37, 0.2);
    --border-chat-top: rgba(255, 186, 37, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(255, 186, 37, 0.3);
    --volume-track: #1e4f44;
    --volume-fill: #ffba25;
    --thumb-border: #ab0004;
    --grayscale-filter: grayscale(75%);
    --toggle-bg: #ab0004;
    --toggle-active: #ffba25;
}

/* Dark Mode Variables */
.dark-mode {
    --bg-primary: #05100e;
    --bg-card: rgba(0, 0, 0, 0.4);
    --bg-chat: rgba(0, 0, 0, 0.5);
    --bg-message: rgba(255, 186, 37, 0.05);
    --bg-input: #05100e;
    --bg-select: #6b0002;
    --bg-select-hover: #4a0001;
    --bg-button-hover: #d4a017;
    --bg-cooldown: rgba(107, 0, 2, 0.4);
    --bg-scrollbar-track: rgba(255, 255, 255, 0.03);
    --bg-message-hover: rgba(255, 186, 37, 0.1);
    --bg-chat-input-focus: rgba(255, 186, 37, 0.03);
    --bg-system-message: rgba(255, 186, 37, 0.08);
    --bg-black-overlay: rgba(0, 0, 0, 0.3);
    --bg-black-overlay-2: rgba(0, 0, 0, 0.5);
    --text-primary: #e0e0e0;
    --text-secondary: rgba(224, 224, 224, 0.5);
    --text-accent: #d4a017;
    --text-red: #ff6b6b;
    --border-primary: #b8941f;
    --border-secondary: #6b0002;
    --border-message: rgba(212, 160, 23, 0.2);
    --border-chat-top: rgba(212, 160, 23, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --shadow-hover: rgba(212, 160, 23, 0.25);
    --volume-track: #0a2e26;
    --volume-fill: #d4a017;
    --thumb-border: #6b0002;
    --grayscale-filter: grayscale(60%);
    --toggle-bg: #ab0004;
    --toggle-active: #ffba25;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    filter: var(--grayscale-filter);
    transition: background-color 0.5s ease, color 0.5s ease, filter 1s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
}

body.logged-out {
    filter: grayscale(0%);
}

body.audio-playing {
    filter: grayscale(0%);
}

/* Dark Mode Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-primary);
    background: var(--toggle-bg);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px var(--shadow-color);
    outline: none;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.dark-mode .theme-toggle {
    background: var(--toggle-active);
}

.radio-card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 32px;
    padding: 28px 24px 24px;
    max-width: 500px;
    width: 100%;
    margin: 10px 0;
    box-shadow: 0 10px 30px var(--shadow-color);
    backdrop-filter: blur(2px);
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.logo-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(32px, 10vw, 48px);
    margin: 8px 0 28px 0;
    color: var(--text-accent);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 0 var(--text-red), 3px 3px 8px var(--shadow-color);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.select-wrapper {
    width: 100%;
    margin-bottom: 28px;
}

select {
    text-align: center;
    padding: 8px 8px;
    border-radius: 20px;
    background-color: var(--bg-select);
    color: var(--text-primary);
    width: 80%;
    max-width: 300px;
    margin: 0 auto;
    font-family: 'Vazirr', Dubai, Arial;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--border-primary);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23ffba25" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 20px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

select:hover {
    background-color: var(--bg-select-hover);
}

option {
    padding: 12px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 18px;
}

.audio-player {
    display: none;
}

.volume-section {
    margin: 10px 0 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slider-rtl-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 320px;
    direction: rtl;
}

.speaker-icon {
    color: var(--text-accent);
    font-size: 24px;
    min-width: 30px;
    text-align: center;
    transition: color 0.5s ease;
}

.volume-percentage {
    color: var(--text-accent);
    font-weight: bold;
    font-size: 18px;
    min-width: 45px;
    text-align: center;
    transition: color 0.5s ease;
}

input[type="range"] {
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to left, var(--volume-fill) 0%, var(--volume-fill) var(--volume-percent, 80%), var(--volume-track) var(--volume-percent, 80%), var(--volume-track) 100%);
    border-radius: 20px;
    outline: none;
    border: 1px solid var(--border-primary);
    --volume-percent: 80%;
    transition: border-color 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--volume-fill);
    border-radius: 50%;
    border: 2px solid var(--thumb-border);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--volume-fill);
    border-radius: 50%;
    border: 2px solid var(--thumb-border);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.connection-hint {
    color: var(--text-primary);
    font-size: 15px;
    margin: 5px;
    transition: color 0.5s ease;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 30px;
    font-size: 18px;
    color: var(--text-primary);
    width: 100%;
    transition: color 0.5s ease;
}

.footer-content a {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 800;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: var(--text-primary);
}

.stats-box {
    font-size: 14px;
    padding: 8px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 3px 0;
    opacity: 0.8;
    width: 80%;
    max-width: 400px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

.flbox-link {
    text-decoration: none;
    display: block;
    width: 80%;
    max-width: 400px;
    margin: 3px 0;
}

.flbox {
    background: var(--text-accent);
    padding: 8px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-secondary);
    font-size: 20px;
    font-weight: bold;
    color: var(--border-secondary);
    transition: background-color 0.3s, color 0.3s;
    max-width: 400px;
}

.flbox-link:hover .flbox,
.flbox:hover {
    background: var(--border-secondary);
    color: var(--text-primary);
}

.flbox a {
    color: var(--border-secondary);
    text-decoration: none;
    font-weight: 800;
}

.flbox a:hover {
    color: var(--text-primary);
}

.stats-footer {
    margin-top: 30px;
    color: var(--text-accent);
    font-weight: bold;
    font-size: 18px;
    text-shadow: 2px 2px 0 var(--border-secondary), 3px 3px 8px var(--shadow-color);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .theme-toggle {
        width: 44px;
        height: 44px;
        top: 15px;
        left: 15px;
    }
    
    .radio-card {
        padding: 20px 14px 18px;
        border-radius: 28px;
    }
    
    select {
        max-width: 100%;
        font-size: 18px;
        padding: 8px 8px;
    }
    
    .footer-content {
        font-size: 16px;
    }
    
    .slider-rtl-container {
        gap: 10px;
    }
    
    .volume-percentage {
        font-size: 16px;
        min-width: 40px;
    }
}

a, select {
    transition: background-color 0.15s, border-color 0.15s;
}

/* Auth styles */
.auth-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.auth-trigger {
    width: 80%;
    max-width: 300px;
    cursor: pointer;
}

.auth-trigger .flbox {
    width: 100%;
}

.auth-forms {
    width: 80%;
    max-width: 300px;
    margin-top: 20px;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
    max-height: 0;
    opacity: 0;
}

.auth-forms.active {
    max-height: 500px;
    opacity: 1;
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.register-form {
    display: none;
}

.auth-forms.show-register .login-form {
    display: none;
}

.auth-forms.show-register .register-form {
    display: flex;
}

.form-title {
    color: var(--text-red);
    background-color: var(--text-accent);
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    opacity: 1;
}

.auth-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 20px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 16px;
    border: 2px solid var(--border-primary);
    outline: none;
    text-align: center;
    direction: rtl;
    transition: border-color 0.3s, background-color 0.5s ease, color 0.5s ease;
}

.auth-input:focus {
    border-color: var(--border-secondary);
}

.auth-input::placeholder {
    color: var(--text-secondary);
}

.auth-btn {
    width: 100%;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
}

.form-switch {
    width: 100%;
    font-size: 14px;
    color: var(--text-primary);
    transition: color 0.5s ease;
}

.switch-link {
    color: var(--text-accent);
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}

.switch-link:hover {
    color: var(--text-primary);
}

.message-box {
    width: 80%;
    max-width: 300px;
    padding: 10px;
    margin-top: 10px;
    border-radius: 20px;
    background: rgba(255, 186, 37, 0.2);
    border: 1px solid var(--border-primary);
    color: var(--text-accent);
    font-size: 14px;
    text-align: center;
}

.user-info-box {
    font-size: 16px;
    color: var(--text-accent);
    margin-bottom: 10px;
    font-weight: bold;
    transition: color 0.5s ease;
}

.logout-form {
    width: 80%;
    max-width: 400px;
    margin: 0 0 5px 0;
}

.logout-form button {
    width: 100%;
    border: none;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    cursor: pointer;
}

/* Add transition to radio elements */
.radio-elements {
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease, margin-bottom 0.4s ease;
    overflow: hidden;
    max-height: 600px;
    opacity: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toggle Buttons Container */
.toggle-buttons {
    width: 90%;
    max-width: 450px;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toggle Button Styles */
.toggle-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 20px;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-toggle-btn {
    background: transparent;
    color: var(--text-accent);
    margin-top: 15px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

.chat-toggle-btn:hover {
    background: var(--text-accent);
    color: var(--border-secondary);
    transform: scale(1.02);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.chat-toggle-btn:active {
    transform: scale(0.98);
}

.radio-toggle-btn {
    background: transparent;
    color: var(--text-accent);
    margin-top: 15px;
    transition: color 0.5s ease, border-color 0.5s ease;
}

.radio-toggle-btn:hover {
    background: var(--text-accent);
    color: var(--border-secondary);
    transform: scale(1.02);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.radio-toggle-btn:active {
    transform: scale(0.98);
}

/* Chat Box Styles */
.chat-container {
    width: 90%;
    max-width: 450px;
    margin: 0 auto;
    background: var(--bg-chat);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, background 0.5s ease, border-color 0.5s ease;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-black-overlay);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-scrollbar-track);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--text-accent);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

.chat-message {
    display: flex;
    flex-direction: column;
    animation: slideInMessage 0.3s ease;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
    padding: 0 4px;
}

.message-username {
    font-weight: bold;
    color: var(--text-accent);
    font-size: 13px;
    text-shadow: 1px 1px 2px var(--shadow-color);
    transition: color 0.5s ease;
}

.message-time {
    color: var(--text-secondary);
    font-size: 11px;
    direction: ltr;
    transition: color 0.5s ease;
}

.message-body {
    color: var(--text-primary);
    font-size: 14px;
    background: var(--bg-message);
    border: 1px solid var(--border-message);
    border-radius: 12px;
    padding: 8px 12px;
    word-wrap: break-word;
    line-height: 1.6;
    text-align: right;
    transition: background 0.3s ease, color 0.5s ease, border-color 0.5s ease;
}

.message-body:hover {
    background: var(--bg-message-hover);
}

.chat-input-container {
    display: flex;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-black-overlay-2);
    transition: border-color 0.5s ease;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 14px;
    outline: none;
    direction: rtl;
    transition: color 0.5s ease, background 0.3s ease;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.chat-input:focus {
    background: var(--bg-chat-input-focus);
}

.chat-send-btn {
    padding: 12px 20px;
    background: var(--text-accent);
    color: var(--border-secondary);
    border: none;
    border-right: 1px solid var(--border-secondary);
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: var(--border-secondary);
    color: var(--text-accent);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn:not(:disabled):active {
    transform: scale(0.95);
}

.chat-cooldown {
    text-align: center;
    padding: 8px 12px;
    background: var(--bg-cooldown);
    color: var(--text-accent);
    font-size: 12px;
    border-top: 1px solid var(--border-primary);
    animation: pulse 1s ease infinite;
    transition: color 0.5s ease, border-color 0.5s ease, background 0.5s ease;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.chat-info {
    text-align: center;
    padding: 8px;
    background: var(--bg-black-overlay-2);
    color: rgba(255, 186, 37, 0.7);
    font-size: 11px;
    border-top: 1px solid var(--border-chat-top);
}

.chat-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 14px;
    animation: pulse 2s ease infinite;
    transition: color 0.5s ease;
}

.chat-system-message {
    text-align: center;
    color: var(--text-accent);
    font-size: 12px;
    padding: 15px;
    background: var(--bg-system-message);
    border-radius: 8px;
    border: 1px dashed var(--border-chat-top);
    transition: color 0.5s ease, background 0.5s ease, border-color 0.5s ease;
}

/* Ensure proper spacing for toggle buttons */
.toggle-buttons {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-messages {
        height: 500px;
    }
    
    .toggle-btn {
        font-size: 16px;
        padding: 10px 16px;
    }
    
    .chat-input {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .chat-send-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Player Control Buttons */
.player-controls {
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
margin: 20px 0;
width: 100%;
}

.control-btn {
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid #ffba25;
background: #ab0004;
color: #ffba25;
font-size: 20px;
cursor: pointer;
transition: all 0.3s ease;
/* display: flex; */
align-items: center;
justify-content: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
background: #ffba25;
color: #ab0004;
transform: scale(1.1);
box-shadow: 0 6px 12px rgba(255, 186, 37, 0.4);
}

.control-btn:active {
transform: scale(0.95);
}

.control-btn.play-btn {
width: 60px;
height: 60px;
font-size: 24px;
background: #ffba25;
color: #ab0004;
border-width: 3px;
}

.control-btn.play-btn:hover {
background: #ab0004;
color: #ffba25;
}

.control-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
