@font-face {
    font-family: 'Vazirr';
    src: url('/Vazirr.woff2');
}

* {
    box-sizing: border-box;
    margin: 0;
}

body.logged-out {
    filter: grayscale(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: #0d372e;
    color: #fff;
    direction: rtl;
    text-align: right;
    /* filter: grayscale(75%); */
    transition: filter 1s ease;
    -webkit-user-select: none;  /* Chrome, Safari, Edge */
    -moz-user-select: none;     /* Firefox */
    -ms-user-select: none;      /* IE/Edge */
    user-select: none;          /* Standard */
}
body.logged-out.audio-playing {
    filter: grayscale(0%);
}
body.audio-playing {
    filter: grayscale(0%);
}

.radio-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid #ffba25;
    border-radius: 32px;
    padding: 28px 24px 24px;
    max-width: 500px;
    width: 100%;
    margin: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.logo-img {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(32px, 10vw, 48px);
    margin: 8px 0 8px 0;
    color: #ffba25;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 0 #ab0004, 3px 3px 8px rgba(0,0,0,0.4);
}

.select-wrapper {
    width: 100%;
    margin-bottom: 28px;
}

select {
    text-align: center;
    padding: 8px 8px;
    border-radius: 20px;
    background-color: #ab0004;
    color: #fff;
    width: 80%;
    max-width: 300px;
    margin: 0 auto;
    font-family: 'Vazirr', Dubai, Arial;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #ffba25;
    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;
}

select:hover {
    background-color: #8b0003;
}

option {
    padding: 12px;
    background-color: #0d372e;
    color: #fff;
    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: #ffba25;
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.volume-percentage {
    color: #ffba25;
    font-weight: bold;
    font-size: 18px;
    min-width: 45px;
    text-align: center;
}

input[type="range"] {
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to left, #ffba25 0%, #ffba25 var(--volume-percent, 80%), #1e4f44 var(--volume-percent, 80%), #1e4f44 100%);
    border-radius: 20px;
    outline: none;
    border: 1px solid #ffba25;
    --volume-percent: 80%;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #ffba25;
    border-radius: 50%;
    border: 2px solid #ab0004;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #ffba25;
    border-radius: 50%;
    border: 2px solid #ab0004;
    cursor: pointer;
}

.connection-hint {
    color: #fff;
    font-size: 24px;
    margin: 10px;
    text-align: justify;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 30px;
    font-size: 18px;
    color: #fff;
    width: 100%;
}

.footer-content a {
    color: #ffba25;
    text-decoration: none;
    font-weight: 800;
}

.footer-content a:hover {
    color: #fff;
}

.stats-box {
    font-size: 14px;
    padding: 8px 8px;
    border-radius: 20px;
    border: 1px solid #ffba25;
    color: #fff;
    line-height: 1.5;
    margin: 3px 0;
    opacity: 0.8;
    width: 80%;
    max-width: 400px;
}
.flbox-link {
    text-decoration: none;
    display: block;
    width: 80%;
    max-width: 400px;
    margin: 3px 0;
}

.flbox {
    background: #ffba25;
    padding: 8px 8px;
    border-radius: 20px;
    border: 1px solid #ab0004;
    font-size: 20px;
    font-weight: bold;
    color: #ab0004;
    transition: background-color 0.3s, color 0.3s;
    max-width: 400px;
}

.flbox-link:hover .flbox,
.flbox:hover {
    background: #ab0004;
    color: #fff;
}
.flbox a {
    color: #ab0004;
    text-decoration: none;
    font-weight: 800;
}

.flbox a:hover {
    color: #fff;
}

.stats-footer {
    margin-top: 30px;
    color: #ffba25;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 2px 2px 0 #ab0004, 3px 3px 8px rgba(0,0,0,0.4);
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    .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: #ab0004;
    background-color: #ffba25;
    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: #0d372e;
    color: #fff;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 16px;
    border: 2px solid #ffba25;
    outline: none;
    text-align: center;
    direction: rtl;
    transition: border-color 0.3s;
}

.auth-input:focus {
    border-color: #ab0004;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.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: #fff;
}

.switch-link {
    color: #ffba25;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}

.switch-link:hover {
    color: #fff;
}

.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 #ffba25;
    color: #ffba25;
    font-size: 14px;
    text-align: center;
}

.user-info-box {
    font-size: 16px;
    color: #ffba25;
    margin-bottom: 10px;
    font-weight: bold;
}

.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: 800px;
    opacity: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toggle Buttons Container */
.toggle-buttons {
    width: 90%;
    max-width: 600px;
    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 #ffba25;
    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: #ffba25;
    margin-top: 15px;
}

.chat-toggle-btn:hover {
    background: #ffba25;
    color: #ab0004;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 186, 37, 0.3);
}

.chat-toggle-btn:active {
    transform: scale(0.98);
}

.radio-toggle-btn {
    background: transparent;
    color: #ffba25;
    margin-top: 15px;
}

.radio-toggle-btn:hover {
    background: #ffba25;
    color: #ab0004;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 186, 37, 0.3);
}

.radio-toggle-btn:active {
    transform: scale(0.98);
}

/* Chat Box Styles */
.chat-container {
    width: 90%;
    max-width: 450px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #ffba25;
    border-radius: 16px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}
/* Hide votes for specific categories */
.chat-container[data-category="goftogoo"] .message-votes {
    display: none !important;
}
.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ffba25;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ab0004;
}

.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: #ffba25;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.message-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    direction: ltr;
}

.message-body {
    color: #fff;
    font-size: 14px;
    background: rgba(255, 186, 37, 0.08);
    border: 1px solid rgba(255, 186, 37, 0.2);
    border-radius: 12px;
    padding: 8px 12px;
    word-wrap: break-word;
    line-height: 1.6;
    text-align: right;
    transition: background 0.3s ease;
    white-space: pre-wrap; /* THIS IS CRUCIAL - preserves line breaks */
    word-break: break-word; /* Breaks long words if needed */
}
.message-line {
    display: block;
    margin-bottom: 5px; /* Adjust spacing between lines */
}

.message-line:last-child {
    margin-bottom: 0;
}
.message-body:hover {
    background: rgba(255, 186, 37, 0.15);
}

.chat-input-container {
    display: flex;
    border-top: 1px solid #ffba25;
    background: rgba(0, 0, 0, 0.3);
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 14px;
    outline: none;
    direction: rtl;
    text-align: right;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
    background: rgba(255, 186, 37, 0.05);
}

/* Custom scrollbar for textarea */
.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-track {
    background: transparent;
}

.chat-input::-webkit-scrollbar-thumb {
    background: rgba(255, 186, 37, 0.5);
    border-radius: 2px;
}

.chat-send-btn {
    padding: 12px 20px;
    background: #ffba25;
    color: #ab0004;
    border: none;
    border-right: 1px solid #ab0004;
    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: #ab0004;
    color: #ffba25;
}

.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: rgba(171, 0, 4, 0.3);
    color: #ffba25;
    font-size: 12px;
    border-top: 1px solid #ffba25;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.chat-info {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 186, 37, 0.7);
    font-size: 11px;
    border-top: 1px solid rgba(255, 186, 37, 0.3);
}

.chat-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 20px;
    font-size: 14px;
    animation: pulse 2s ease infinite;
}

.chat-system-message {
    text-align: center;
    color: #ffba25;
    font-size: 12px;
    padding: 15px;
    background: rgba(255, 186, 37, 0.1);
    border-radius: 8px;
    border: 1px dashed rgba(255, 186, 37, 0.3);
}

/* 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;
    }
}
.chat-char-count {
    text-align: left;
    direction: ltr;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    border-top: 1px solid rgba(255, 186, 37, 0.2);
}

.chat-char-count.near-limit {
    color: #ffba25;
}

.chat-char-count.at-limit {
    color: #ff6b6b;
    font-weight: bold;
}


/* Add transitions to logo and h1 */
.logo-img {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    transition: all 0.4s ease;
}

.logo-img.small-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
}

h1 {
    font-size: clamp(32px, 10vw, 48px);
    margin: 8px 0 28px 0;
    color: #ffba25;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 2px 2px 0 #ab0004, 3px 3px 8px rgba(0,0,0,0.4);
    transition: all 0.4s ease;
}

h1.small-title {
    font-size: clamp(22px, 6vw, 30px);
    margin: 5px 0 10px 0;
}

/* Player container adjustments */
.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    transition: all 0.4s ease;
}

/* When chat is active, make the header compact */
.player-container.chat-active {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 5px 0;
}
@media (max-width: 480px) {
    /* ... existing mobile styles ... */
    
    .logo-img.small-logo {
        width: 30px;
        height: 30px;
    }
    
    h1.small-title {
        font-size: clamp(16px, 4vw, 20px);
        margin: 3px 0 8px 0;
    }
    
    .player-container.chat-active {
        gap: 8px;
    }
}
/* Vote buttons styles */
.message-votes {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 0 4px;
    direction: ltr;
    justify-content: flex-start;
}

.vote-btn {
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Vazirr', Dubai, Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    min-width: 40px;
    justify-content: center;
}

.vote-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.vote-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.vote-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.vote-up {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.vote-up:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.4);
    border-color: #4caf50;
}

.vote-up.voted {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
    opacity: 0.8;
}

.vote-down {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.vote-down:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.4);
    border-color: #f44336;
}

.vote-down.voted {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
    opacity: 0.8;
}

.vote-count {
    font-size: 12px;
    min-width: 16px;
    text-align: center;
    color: #fff;
}

.vote-score {
    font-size: 12px;
    color: #ffba25;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.vote-icon {
    font-size: 10px;
}