/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f0f0f;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #222;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #53fc18;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    font-weight: 400;
}

/* Panels */
.panel {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.panel h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

.panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Connection Controls */
.connection-controls,
.test-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #aaa;
}

.optional-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

input[type="text"] {
    background-color: #0f0f0f;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #53fc18;
}

input[type="text"]::placeholder {
    color: #555;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background-color: #53fc18;
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    background-color: #45d416;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #3a3a3a;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status */
.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #0f0f0f;
    border-radius: 6px;
}

.status-label {
    font-weight: 500;
    color: #888;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #555;
    transition: background-color 0.3s;
}

.status-dot.connected {
    background-color: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

#status-text {
    font-weight: 600;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #2a2a2a;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #53fc18;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #45d416;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #53fc18;
    cursor: pointer;
    border: none;
}

.select-input {
    width: 100%;
    background: #1a1a1a;
    border: 2px solid #333;
    color: #e0e0e0;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.select-input:focus {
    border-color: #53fc18;
    outline: none;
}

/* Toggle Switch */
.reading-control {
    padding: 1rem;
    background-color: #0f0f0f;
    border-radius: 6px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #2a2a2a;
    border-radius: 13px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-slider {
    background-color: #53fc18;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
    color: #e0e0e0;
}

/* Chat Log */
.chat-log {
    background-color: #0f0f0f;
    border-radius: 6px;
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-log::-webkit-scrollbar {
    width: 8px;
}

.chat-log::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.chat-log::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.chat-log::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.chat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #555;
    text-align: center;
}

.chat-message {
    padding: 0.75rem;
    background-color: #1a1a1a;
    border-left: 3px solid #53fc18;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.chat-username {
    font-weight: 600;
    color: #53fc18;
}

.chat-voice {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

.chat-text {
    color: #e0e0e0;
    word-wrap: break-word;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Stats Panel */
.stats-panel {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    background-color: #1a1a1a;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #2a2a2a;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #53fc18;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #555;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .connection-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chat-log {
        height: 300px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Landing Page */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.landing-header {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.landing-header h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #53fc18 0%, #53fc18 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-main {
    text-align: center;
}

.landing-desc {
    color: #888;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.landing-buttons {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.landing-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 3rem;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 200px;
}

.landing-btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border: 2px solid #53fc18;
}

.landing-btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(74, 158, 255, 0.3);
}

.landing-btn-secondary {
    background: linear-gradient(135deg, #1a3d1a 0%, #2d5a2d 100%);
    border: 2px solid #53fc18;
}

.landing-btn-secondary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(83, 252, 24, 0.3);
}

.btn-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.btn-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.btn-subtitle {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 0.25rem;
}

.landing-footer {
    margin-top: 4rem;
    color: #555;
    font-size: 0.9rem;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-box h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.login-box .input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.login-box .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-error {
    color: #ff4444;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

/* Blacklist */
.blacklist-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.blacklist-list {
    background: #0f0f0f;
    border-radius: 6px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.blacklist-empty {
    color: #555;
    text-align: center;
    margin: 0;
}

.blacklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #1a1a1a;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.blacklist-item:last-child {
    margin-bottom: 0;
}

.blacklist-item span {
    color: #e0e0e0;
}

.blacklist-remove {
    background: transparent;
    border: none;
    color: #ff4444;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.blacklist-remove:hover {
    background: rgba(255, 68, 68, 0.2);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #1a1a1a;
    padding: 0.5rem;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: #53fc18;
    color: #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.panel-desc {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.setting-hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-left: 3.5rem;
}

/* Queue List */
.queue-list {
    min-height: 200px;
    max-height: 400px;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
}

.queue-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    flex: 1;
}

.queue-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.queue-time {
    color: #666;
    font-size: 0.8rem;
    font-family: monospace;
}

.queue-username {
    font-weight: 600;
    color: #53fc18 !important;
    font-size: 0.9rem;
}

.queue-message {
    color: #bbb !important;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}