@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Main Theme Dark System */
    --bg-dark: #0a0a0f;
    --bg-card: rgba(18, 18, 29, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f3f3f7;
    --text-muted: #9898a6;
    
    /* Branding Colors */
    --primary: #6366f1; /* Futuristic Violet */
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    /* Niche Accent Colors */
    --academic: #f59e0b; /* Amber */
    --academic-glow: rgba(245, 158, 11, 0.35);
    --academic-secondary: #0ea5e9; /* Light Blue */
    
    --business: #10b981; /* Emerald */
    --business-glow: rgba(16, 185, 129, 0.35);
    
    --casual: #f43f5e; /* Rose/Coral */
    --casual-glow: rgba(244, 63, 94, 0.35);
    
    /* Control Colors */
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.35);
    
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Landing Page (index.html) Styles
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 2.2rem;
    height: 2.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #a5b4fc 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    color: #a5b4fc;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin: 4.5rem auto 3rem auto;
    padding: 0 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Room Creator/Joiner Section */
.room-actions {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto 4rem auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tab-buttons {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.input-container {
    position: relative;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1rem 0.85rem 2.5rem;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.niche-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.niche-select-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.niche-select-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.niche-select-btn span {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Niche Button Selection States */
.niche-select-btn[data-niche="academic"]:hover,
.niche-select-btn[data-niche="academic"].selected {
    border-color: var(--academic);
    background: rgba(245, 158, 11, 0.06);
    color: var(--academic);
}

.niche-select-btn[data-niche="business"]:hover,
.niche-select-btn[data-niche="business"].selected {
    border-color: var(--business);
    background: rgba(16, 185, 129, 0.06);
    color: var(--business);
}

.niche-select-btn[data-niche="casual"]:hover,
.niche-select-btn[data-niche="casual"].selected {
    border-color: var(--casual);
    background: rgba(244, 63, 94, 0.06);
    color: var(--casual);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    border: none;
    color: #fff;
    padding: 0.95rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.35);
}

/* Niches Presentation Section */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.2rem;
}

.niches-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 5rem auto;
    padding: 0 1.5rem;
}

.niche-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.niche-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

/* Niche Theme Details */
.niche-card.academic::before { background: var(--academic); }
.niche-card.academic:hover { box-shadow: 0 15px 30px var(--academic-glow); border-color: rgba(245, 158, 11, 0.3); }

.niche-card.business::before { background: var(--business); }
.niche-card.business:hover { box-shadow: 0 15px 30px var(--business-glow); border-color: rgba(16, 185, 129, 0.3); }

.niche-card.casual::before { background: var(--casual); }
.niche-card.casual:hover { box-shadow: 0 15px 30px var(--casual-glow); border-color: rgba(244, 63, 94, 0.3); }

.niche-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.academic .niche-icon-wrapper { background: rgba(245, 158, 11, 0.1); color: var(--academic); }
.business .niche-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: var(--business); }
.casual .niche-icon-wrapper { background: rgba(244, 63, 94, 0.1); color: var(--casual); }

.niche-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.niche-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.feature-list {
    list-style: none;
    margin-bottom: 2rem;
    text-align: left;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.feature-list svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.academic .feature-list svg { color: var(--academic); }
.business .feature-list svg { color: var(--business); }
.casual .feature-list svg { color: var(--casual); }

.price-box {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.price-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.price-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

.price-value span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.price-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-top: 0.5rem;
}

.academic .price-badge { background: rgba(245, 158, 11, 0.1); color: var(--academic); border: 1px solid rgba(245, 158, 11, 0.2); }
.business .price-badge { background: rgba(16, 185, 129, 0.1); color: var(--business); border: 1px solid rgba(16, 185, 129, 0.2); }
.casual .price-badge { background: rgba(244, 63, 94, 0.1); color: var(--casual); border: 1px solid rgba(244, 63, 94, 0.2); }


/* ==========================================================================
   Room Workspace Styles (Common Room Elements)
   ========================================================================== */
.room-container {
    display: grid;
    grid-template-rows: 60px 1fr 80px;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Room Header */
.room-header {
    background: rgba(18, 18, 29, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 10;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.room-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.room-code-display {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.room-code-display:hover {
    color: #fff;
}

.room-actions-header {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Room Main Area */
.room-main {
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
}

.room-main.has-sidebar {
    grid-template-columns: 1fr 340px;
}

.room-main.has-double-sidebar {
    grid-template-columns: 340px 1fr 340px;
}

/* Video Space Grid */
.video-space {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    position: relative;
    background: #050508;
}

.video-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 1fr;
}

/* Specific Grid Layouts for Video Feeds */
.video-grid.peers-1 { grid-template-columns: 1fr; }
.video-grid.peers-2 { grid-template-columns: 1fr 1fr; }
.video-grid.peers-3, .video-grid.peers-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.video-card {
    background: #12121d;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    aspect-ratio: 16/9;
}

.video-card video, .video-card .mock-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card .mock-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1b1b2f 0%, #0d0d18 100%);
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px var(--primary-glow);
}

.video-card .video-label {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 2;
}

.video-card .video-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.status-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.status-badge.danger {
    color: var(--danger);
}

/* Sidebar Styling (Chat, Notes, Whiteboard) */
.room-sidebar {
    background: rgba(18, 18, 29, 0.95);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 5;
    overflow: hidden;
}

.room-sidebar.left-sidebar {
    border-left: none;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Chat Styles */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: 90%;
}

.chat-bubble .msg-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    padding: 0 0.25rem;
}

.chat-bubble .msg-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-bubble.self {
    align-self: flex-end;
}

.chat-bubble.self .msg-content {
    background: var(--primary);
    color: #fff;
}

.chat-input-wrapper {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #fff;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-send {
    background: var(--primary);
    border: none;
    color: #fff;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.btn-send:hover {
    transform: scale(1.05);
}

/* Whiteboard Styles (Education specific) */
.whiteboard-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.whiteboard-controls {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wb-btn {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.wb-btn:hover, .wb-btn.active {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.wb-color-picker {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    cursor: pointer;
    padding: 0;
}

.whiteboard-canvas {
    flex-grow: 1;
    background: #ffffff;
    cursor: crosshair;
}

/* Collaborative Notes (Business specific) */
.notes-editor {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.notes-editor:focus {
    border-color: var(--business);
}

/* Room Control Footer */
.room-footer {
    background: rgba(18, 18, 29, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 10;
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.control-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.control-btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 15px var(--danger-glow);
}

.control-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.control-btn svg {
    width: 1.35rem;
    height: 1.35rem;
}

/* Specific space color variations for control buttons */
.education-room .control-btn.active { background: var(--academic); border-color: var(--academic); box-shadow: 0 0 15px var(--academic-glow); }
.business-room .control-btn.active { background: var(--business); border-color: var(--business); box-shadow: 0 0 15px var(--business-glow); }
.casual-room .control-btn.active { background: var(--casual); border-color: var(--casual); box-shadow: 0 0 15px var(--casual-glow); }


/* ==========================================================================
   Responsiveness & Mobile layout updates
   ========================================================================== */
@media (max-width: 900px) {
    .niches-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .niche-select-grid {
        grid-template-columns: 1fr;
    }
    
    .room-main.has-sidebar, .room-main.has-double-sidebar {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 280px;
    }
    
    .room-sidebar {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

@media (max-width: 600px) {
    /* Navbar & Hero Mobile */
    .navbar {
        padding: 0.75rem 1rem;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .btn-secondary {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    .hero {
        margin: 2.5rem auto 2rem auto;
        padding: 0 1rem;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    .room-actions {
        padding: 1.25rem;
        margin: 0 1rem 2rem 1rem;
        border-radius: 12px;
    }
    
    /* Live Room Mobile Layout Overrides */
    .room-header {
        padding: 0 0.75rem;
    }
    .room-info h2 {
        font-size: 0.95rem;
    }
    .room-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.7rem;
    }
    .room-actions-header {
        gap: 0.35rem;
    }
    .room-actions-header .btn-secondary {
        padding: 0.35rem 0.55rem;
        font-size: 0.75rem;
    }
    
    /* Video grid sizing */
    .video-space {
        padding: 0.75rem;
    }
    .video-grid {
        gap: 0.5rem;
    }
    .video-card .video-label {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }
    .avatar-circle {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    /* Live Room Footer Controls */
    .room-footer {
        padding: 0 0.5rem;
    }
    .control-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    .control-btn svg {
        width: 1.1rem;
        height: 1.1rem;
    }
    
    /* Notes & Chat Panels on Mobile */
    .notes-editor {
        height: 110px;
    }
    .sidebar-header {
        padding: 0.75rem 1rem;
    }
    .sidebar-content {
        padding: 0.75rem;
    }
}
