:root {
    --primary-color: #0078d4;
    --background-color: #1e1e1e;
    --surface-color: #252526;
    --text-color: #000000;
    --text-secondary: #cccccc;
    --success-color: #4caf50;
    --error-color: #f44336;
    --chat-bg: #2d2d30;
    --chat-message-bg: #3e3e42;
    --chat-own-message-bg: #0078d4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.stream-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: left;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2.5rem;
}

.status-message {
    text-align: center;
    padding: 40px;
    background-color: var(--surface-color);
    border-radius: 8px;
    margin: 20px 0;
}

.status-message p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.status-message .hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Access Link Container */
.access-link-container {
    text-align: center;
    padding: 60px 40px;
    background-color: var(--surface-color);
    border-radius: 12px;
    margin: 40px auto;
    max-width: 700px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.access-link-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.access-link-container .hint {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.access-link-container code {
    background-color: var(--background-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--primary-color);
    font-size: 1rem;
    display: inline-block;
    margin: 10px 0;
}

/* Video Container */
.video-container {
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Stream Content Wrapper - Side by side layout */
.stream-content-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
}

.stream-main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Chat Panel Styles */
.chat-panel {
    width: 350px;
    background-color: var(--chat-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.chat-user-info {
    margin: 5px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 10px;
    background-color: var(--chat-message-bg);
    border-radius: 8px;
    max-width: 85%;
    align-self: flex-start;
}

.chat-message.own-message {
    background-color: var(--chat-own-message-bg);
    align-self: flex-end;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-message-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.chat-message.own-message .chat-message-name {
    color: rgba(255, 255, 255, 0.9);
}

.chat-message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-message-text {
    color: var(--text-secondary);
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-message.own-message .chat-message-text {
    color: white;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    padding: 10px 20px;
    white-space: nowrap;
}

/* Chat Registration Form */
.chat-registration-form {
    max-width: 400px;
    margin: 30px auto 0;
    text-align: left;
}

.chat-registration-form .form-group {
    margin-bottom: 20px;
}

.chat-registration-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.chat-registration-form .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    font-size: 1rem;
}

.chat-registration-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-registration-form .btn {
    width: 100%;
    margin-top: 10px;
}

/* Stream Info Styles */
.stream-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-color);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stream-info p {
    margin: 0;
    color: var(--text-secondary);
}

.stream-info strong {
    color: white;
}

/* Moderator Controls */
.moderator-badge-container {
    position: relative;
}

.chat-message .dropdown-toggle {
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message:hover .dropdown-toggle {
    opacity: 1;
}

.dropdown-menu {
    font-size: 0.9rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Stream Thumbnail Styles */
.stream-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.stream-thumbnail-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
}

.card-img-top {
    border-radius: 8px 8px 0 0;
}

/* Thumbnail preview in upload */
.thumbnail-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Stream code card with thumbnail */
.card.stream-code-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card.stream-code-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Block Alert */
.alert {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stream-container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .access-link-container {
        padding: 40px 20px;
    }

    .access-link-container h2 {
        font-size: 1.5rem;
    }

    .code-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .code-input {
        flex: 1;
        font-size: 1.8rem;
    }

    .stream-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .stream-info p {
        margin: 5px 0;
    }

    .stream-content-wrapper {
        flex-direction: column;
    }

    .chat-panel {
        width: 100%;
        height: 400px;
    }
}
