/* Общие стили */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --dark-color: #1b263b;
    --light-color: #f8f9fa;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --border-radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Навигация */
.navbar {
    background-color: var(--dark-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: white !important;
}

/* Основной контейнер */
.container-fluid {
    padding: 20px;
    margin-top: 20px;
}

/* Карточки комнат */
.room-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.room-card .card-body {
    padding: 1.5rem;
}

.room-card .card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Видео плеер */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 соотношение */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
}

/* Элементы управления видео */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#seekBar {
    flex-grow: 1;
    cursor: pointer;
}

/* Чат */
.chat-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    word-wrap: break-word;
}

.message-input-container {
    display: flex;
    padding: 10px;
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    border-top: 1px solid #eee;
}

#messageInput {
    flex-grow: 1;
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 8px 15px;
    margin-right: 10px;
}

/* WebRTC видео */
.webrtc-container {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.webrtc-container video {
    width: 100%;
    border-radius: var(--border-radius);
    background: #000;
    margin-bottom: 10px;
}

.webrtc-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Формы */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-control {
    border-radius: var(--border-radius);
    padding: 10px 15px;
    border: 1px solid #ddd;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.btn {
    border-radius: var(--border-radius);
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Адаптивность */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .video-container {
        margin-bottom: 10px;
    }
    
    .chat-container, .webrtc-container {
        height: auto;
        min-height: 300px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.room-card, .video-container, .chat-container {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Утилиты */
.text-center {
    text-align: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.w-100 { width: 100%; }

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}