/* Dark Theme (Default) */
.theme-dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --accent-color: #b31217;
    --accent-hover: #e52d27;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --link-color: #ffb4b4;
    --code-bg: #2b2b2b;
    --irc-color-0: #f8fafc;
    --irc-color-1: #111827;
    --irc-color-2: #60a5fa;
    --irc-color-3: #4ade80;
    --irc-color-4: #f87171;
    --irc-color-5: #fb7185;
    --irc-color-6: #e879f9;
    --irc-color-7: #fb923c;
    --irc-color-8: #fde047;
    --irc-color-9: #22c55e;
    --irc-color-10: #2dd4bf;
    --irc-color-11: #67e8f9;
    --irc-color-12: #93c5fd;
    --irc-color-13: #f9a8d4;
    --irc-color-14: #cbd5e1;
    --irc-color-15: #e5e7eb;
}

.theme-dark {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.theme-dark .sidebar {
    background-color: var(--bg-secondary);
    border-right-color: var(--border-color);
}

.theme-dark .sidebar-header {
    border-bottom-color: var(--border-color);
}

.theme-dark .channel-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-dark .channel-users {
    background-color: var(--bg-tertiary);
}

.theme-dark .tab {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.theme-dark .tab.active {
    background-color: var(--bg-primary);
    border-bottom-color: var(--bg-primary);
}

.theme-dark .chat-header {
    border-bottom-color: var(--border-color);
}

.theme-dark .chat-messages {
    background-color: var(--bg-primary);
}

.theme-dark .message {
    border-bottom: 1px solid var(--border-color);
}

.theme-dark .message .nickname {
    color: var(--accent-color);
}

.theme-dark .message .text {
    color: var(--text-primary);
}

.theme-dark .message.system {
    color: var(--text-secondary);
    font-style: italic;
}

.theme-dark .message.system .text {
    color: var(--text-secondary);
}

.theme-dark .chat-input-area {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-color);
}

.theme-dark #messageInput,
.theme-dark .channel-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-dark #sendBtn,
.theme-dark .send-btn {
    background-color: var(--accent-color);
    color: white;
}

.theme-dark #sendBtn:hover,
.theme-dark .send-btn:hover {
    background-color: var(--accent-hover);
}

.theme-dark .user-panel {
    background-color: var(--bg-secondary);
    border-left-color: var(--border-color);
}

.theme-dark .user-panel-header {
    border-bottom-color: var(--border-color);
}

.theme-dark .user-item {
    color: var(--text-primary);
}

.theme-dark .user-item:hover {
    background-color: var(--bg-tertiary);
}

.theme-dark .context-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-dark .modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.theme-dark .toolbar-btn {
    color: var(--text-primary);
}

.theme-dark .toolbar-btn:hover {
    background-color: var(--bg-tertiary);
}

.theme-dark .toolbar-btn.recording {
    background-color: #ff4444 !important;
    color: white !important;
    animation: pulse 1s infinite;
}

.theme-dark .connection-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.theme-dark .status-indicator.connected {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.theme-dark .status-indicator.connecting {
    background-color: var(--warning-color);
    animation: pulse 1s infinite;
}

.theme-dark .status-indicator.disconnected {
    background-color: var(--danger-color);
}

/* Estilos para mensagens de áudio no tema escuro */
.theme-dark .audio-message audio {
    background-color: var(--bg-tertiary);
    border-radius: 20px;
    filter: brightness(0.9);
}

.theme-dark .audio-message .audio-duration {
    color: var(--text-secondary);
}

/* Light Theme - CORRIGIDO COMPLETAMENTE */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f0;
    --bg-tertiary: #e0e0e0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #cccccc;
    --accent-color: #b31217;
    --accent-hover: #e52d27;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --link-color: #b31217;
    --code-bg: #f4f4f4;
    --irc-color-0: #111827;
    --irc-color-1: #111827;
    --irc-color-2: #1d4ed8;
    --irc-color-3: #15803d;
    --irc-color-4: #dc2626;
    --irc-color-5: #991b1b;
    --irc-color-6: #a21caf;
    --irc-color-7: #c2410c;
    --irc-color-8: #ca8a04;
    --irc-color-9: #16a34a;
    --irc-color-10: #0f766e;
    --irc-color-11: #0891b2;
    --irc-color-12: #2563eb;
    --irc-color-13: #db2777;
    --irc-color-14: #475569;
    --irc-color-15: #6b7280;
}

.theme-light {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.theme-light .sidebar {
    background-color: var(--bg-secondary);
    border-right-color: var(--border-color);
}

.theme-light .sidebar-header {
    border-bottom-color: var(--border-color);
}

.theme-light .channel-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-light .channel-users {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.theme-light .tab {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.theme-light .tab.active {
    background-color: var(--bg-primary);
    border-bottom-color: var(--bg-primary);
}

.theme-light .chat-header {
    border-bottom-color: var(--border-color);
}

.theme-light .chat-messages {
    background-color: var(--bg-primary);
}

.theme-light .message {
    border-bottom: 1px solid var(--border-color);
}

.theme-light .message .nickname {
    color: var(--accent-color);
}

/* CORREÇÃO: Texto das mensagens no tema claro */
.theme-light .message .text {
    color: var(--text-primary);
}

.theme-light .message.system {
    color: var(--text-secondary);
    font-style: italic;
}

.theme-light .message.system .text {
    color: var(--text-secondary);
}

/* CORREÇÃO: Mensagens privadas no tema claro */
.theme-light .message.private .text {
    color: var(--text-primary);
}

.theme-light .message.private .nickname {
    color: #ffaa00;
}

.theme-light .chat-input-area {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-color);
}

.theme-light #messageInput,
.theme-light .channel-input {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-light #sendBtn,
.theme-light .send-btn {
    background-color: var(--accent-color);
    color: white;
}

.theme-light #sendBtn:hover,
.theme-light .send-btn:hover {
    background-color: var(--accent-hover);
}

.theme-light .user-panel {
    background-color: var(--bg-secondary);
    border-left-color: var(--border-color);
}

.theme-light .user-panel-header {
    border-bottom-color: var(--border-color);
}

.theme-light .user-item {
    color: var(--text-primary);
}

.theme-light .user-item:hover {
    background-color: var(--bg-tertiary);
}

.theme-light .context-menu {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-light .modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.theme-light .toolbar-btn {
    color: var(--text-primary);
}

.theme-light .toolbar-btn:hover {
    background-color: var(--bg-tertiary);
}

.theme-light .toolbar-btn.recording {
    background-color: #ff4444 !important;
    color: white !important;
    animation: pulse 1s infinite;
}

/* CORREÇÃO: Estilos da bolinha de status no tema claro */
.theme-light .connection-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.theme-light .status-indicator.connected {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color), 0 0 0 1px rgba(0,0,0,0.1);
}

.theme-light .status-indicator.connecting {
    background-color: var(--warning-color);
    animation: pulse 1s infinite;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.theme-light .status-indicator.disconnected {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Estilos para mensagens de áudio no tema claro */
.theme-light .audio-message audio {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.theme-light .audio-message .audio-duration {
    color: var(--text-secondary);
}

/* Animações */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Ajustes para o radio player nos temas */
.theme-light .radio-player {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

.theme-light .radio-logo {
    box-shadow: 0 4px 10px rgba(0,123,255,0.2);
}

.theme-light .radio-btn {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-light .radio-btn.play-btn {
    background-color: var(--accent-color);
    color: white;
}

.theme-light .radio-btn.stop-btn {
    background-color: #ff4444;
    color: white;
}

.theme-light .volume-control input[type="range"] {
    background-color: var(--bg-tertiary);
}

.theme-light .volume-control input[type="range"]::-webkit-slider-thumb {
    background-color: var(--accent-color);
}

/* v9 remove italics from server/system text */
.theme-dark .message.system,
.theme-dark .message.system .text,
.theme-light .message.system,
.theme-light .message.system .text {
    font-style: normal !important;
}
