/* WalkieTalk — Professional Discord-style Theme (Red & Black) */

/* ===== Variables ===== */
:root {
    --bg-primary: #0a0a0a;        /* Deepest black */
    --bg-secondary: #141414;      /* Sidebar bg */
    --bg-tertiary: #1a1a1a;       /* Active items, cards */
    --bg-hover: #252525;          /* Hover states */
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-red: #dc2626;         /* Primary red accent */
    --accent-red-dark: #991b1b;    /* Darker red for active bg */
    --accent-red-glow: rgba(220, 38, 38, 0.5);
    --green-glow: rgba(0, 255, 76, 0.5);
    --green-border: #00ff4c;
    --border-color: #2a2a2a;
    --sidebar-width: 260px;
    --topbar-height: 48px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body.theme-dark {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ===== App Wrapper ===== */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

/* Sidebar nav (top section with tabs) */
.sidebar-nav {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    padding: 8px 16px 12px;
    letter-spacing: 0.5px;
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: rgba(220, 38, 38, 0.12);
    border-left-color: var(--accent-red);
    color: var(--text-primary);
}

.nav-tab .tab-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-signup, .nav-signin {
    margin-top: auto;
    padding-top: 12px;
}

.nav-signup {
    background: var(--accent-red);
    color: #fff !important;
    border-radius: 6px;
    margin: 8px 12px;
    justify-content: center;
    font-weight: 600;
}

.nav-signin {
    margin: 4px 12px;
    justify-content: center;
}

.nav-signup:hover {
    background: #e63946 !important;
}

/* Sidebar section (room list) */
.sidebar-section {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.add-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.add-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-red);
}

/* Room list items */
.room-list {
    list-style: none;
}

.room-item {
    padding: 8px 16px 8px 24px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.room-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.room-item.active {
    background: rgba(220, 38, 38, 0.15);
    border-left-color: var(--accent-red);
    color: #fff;
}

/* User section (bottom of sidebar) */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-red-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.user-avatar.green-glow {
    box-shadow: 0 0 12px var(--green-glow), 0 0 4px var(--green-border);
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Top bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.channel-info .hash-tag {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 700;
}

.channel-info h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-actions {
    display: flex;
    gap: 4px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-hover);
}

/* Page sections */
.page-section {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.active-section {
    display: flex;
}

/* Welcome Banner (Home page) */
.welcome-banner {
    text-align: center;
    padding: 60px 20px;
}

.welcome-banner h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 30px;
}

.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Room cards */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.room-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.room-card:hover {
    border-color: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
}

.room-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.room-icon.active-speaker {
    box-shadow: 0 0 16px var(--green-glow), 0 0 5px var(--green-border);
    animation: pulse-green 2s infinite;
}

.room-card-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.room-joiners {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.room-joiners strong {
    color: var(--accent-red);
}

/* Channels page */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 500px;
}

.channel-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.channel-item:hover {
    background: var(--bg-hover);
}

.channel-item.active {
    background: rgba(220, 38, 38, 0.15);
    border-left: 3px solid var(--accent-red);
}

/* Settings page */
.settings-panel {
    max-width: 600px;
}

.setting-group {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.setting-group h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.setting-item select,
.setting-item input[type="range"] {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-red);
}

/* Voice area */
.voice-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 24px 24px;
    overflow-y: auto;
}

/* Speakers row */
.speakers-row {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.speaker-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.speaker-card.green-glow {
    box-shadow: 0 0 12px var(--green-glow), 0 0 4px var(--green-border);
    border: 1px solid rgba(0, 255, 76, 0.3);
    animation: speak-breathe 1.5s ease-in-out infinite;
}

.speaking-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-border);
    opacity: 0.7;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.msg-content {
    flex: 1;
}

.msg-sender {
    font-weight: 600;
    color: var(--accent-red);
    font-size: 0.9rem;
}

.msg-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 8px;
}

.msg-content p {
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.5;
}

.message.mine .msg-sender {
    color: var(--green-border);
}

/* Input area */
.input-area {
    display: flex;
    gap: 8px;
    padding: 16px 0 0;
    border-top: 1px solid var(--border-color);
}

.message-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.message-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-red);
    color: #fff;
}

.btn-primary:hover {
    background: #e63946;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #333;
}

.btn-voice {
    background: var(--accent-red-dark);
    color: #fff;
}

.btn-voice:hover {
    background: var(--accent-red);
}

/* ===== Animations ===== */
@keyframes greenGlow {
    0%, 100% { box-shadow: 0 0 8px var(--green-glow), 0 0 3px var(--green-border); }
    50% { box-shadow: 0 0 20px var(--green-glow), 0 0 8px var(--green-border); }
}

.green-glow {
    animation: greenGlow 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 6px var(--green-glow); }
    50% { box-shadow: 0 0 18px var(--green-glow), 0 0 6px var(--green-border); }
}

@keyframes speak-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .room-grid { grid-template-columns: 1fr; }
}
