* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --danger: #ef4444;
    --success: #10b981;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, #1a1a2e 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: auto;
}

.btn-danger {
    background: var(--danger);
}

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

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.feature .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature p {
    color: var(--text-muted);
}

/* Instructions */
.instructions {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.instructions h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.instructions ol {
    margin-right: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.instructions code {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

/* Room Page */
.room-page {
    padding: 0;
    margin: 0;
}

.room-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    height: 100vh;
    gap: 0;
}

/* Video Section */
.video-section {
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.video-header {
    padding: 1rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.users-count {
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
}

.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sync-indicator {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    display: none;
    z-index: 10;
}

.video-controls {
    padding: 1rem 2rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

/* Chat Section */
.chat-section {
    background: var(--bg-light);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 0.5rem;
    word-wrap: break-word;
}

.chat-message.own-message {
    background: var(--primary);
    margin-left: 2rem;
}

.chat-message.system-message {
    background: transparent;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.message-user {
    font-weight: 600;
    color: var(--secondary);
    margin-left: 0.5rem;
}

.own-message .message-user {
    color: white;
}

.message-text {
    display: block;
    margin-top: 0.25rem;
}

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

.chat-input input {
    flex: 1;
}

.chat-input .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .room-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .chat-section {
        max-height: 300px;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }
}
