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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
}

/* Login Page */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    color: #333;
    padding: 50px 45px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #1e3c72;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 35px;
    font-size: 15px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.form-group input:hover {
    border-color: #b0b0b0;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #2a5298;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 82, 152, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #45a049 0%, #4caf50 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.error-message {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 14px 18px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Room Page */
.room-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1a1a1a;
    overflow: hidden;
}

.video-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    margin-right: 350px;
    min-width: 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 100%;
    height: fit-content;
}

.video-container {
    position: relative;
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    min-height: 200px;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-container.local-video {
    border: 3px solid #4caf50;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
}

.video-status.muted {
    background: #f44336;
}

.audio-control-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-level-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    padding: 0 5px;
}

.audio-level-indicator .audio-bar {
    width: 4px;
    background: #4caf50;
    border-radius: 2px;
    transition: height 0.1s ease;
    height: 4px;
}

.audio-level-indicator .audio-bar.active {
    height: 8px;
}

.audio-level-indicator .audio-bar.active.level-1 {
    height: 10px;
}

.audio-level-indicator .audio-bar.active.level-2 {
    height: 14px;
}

.audio-level-indicator .audio-bar.active.level-3 {
    height: 18px;
}

.audio-level-indicator .audio-bar.active.level-4 {
    height: 22px;
}

.audio-level-indicator .audio-bar.active.level-5 {
    height: 26px;
}

.video-audio-level {
    position: absolute;
    bottom: 50px;
    left: 10px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
}

.video-audio-level .audio-bar {
    width: 4px;
    background: #4caf50;
    border-radius: 2px;
    transition: height 0.1s ease;
    height: 4px;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.6);
}

.video-audio-level .audio-bar.active {
    height: 8px;
}

.video-audio-level .audio-bar.active.level-1 {
    height: 10px;
}

.video-audio-level .audio-bar.active.level-2 {
    height: 14px;
}

.video-audio-level .audio-bar.active.level-3 {
    height: 18px;
}

.video-audio-level .audio-bar.active.level-4 {
    height: 22px;
}

.video-audio-level .audio-bar.active.level-5 {
    height: 26px;
}

/* Controls Section */
.controls-section {
    background: #2a2a2a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #3a3a3a;
    margin-right: 350px;
    flex-shrink: 0;
}

.controls {
    display: flex;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #3a3a3a;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.control-btn:hover {
    background: #4a4a4a;
    transform: scale(1.1);
}

.control-btn.active {
    background: #4caf50;
}

.control-btn:not(.active) {
    background: #f44336;
}

.control-btn:not(.active):hover {
    background: #d32f2f;
}

.control-btn svg {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.control-btn .icon-main {
    opacity: 1;
    transform: scale(1);
}

.control-btn .icon-cross {
    opacity: 0;
    transform: scale(0.8);
}

.control-btn:not(.active) .icon-main {
    opacity: 0;
    transform: scale(0.8);
}

.control-btn:not(.active) .icon-cross {
    opacity: 1;
    transform: scale(1);
}

.control-btn.leave-btn {
    background: #f44336;
}

.control-btn.leave-btn:hover {
    background: #d32f2f;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.copy-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #3a3a3a;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-link-btn:hover {
    background: #4a4a4a;
    transform: translateY(-1px);
}

.copy-link-btn.copied {
    background: #4caf50;
}

.copy-link-btn.copied:hover {
    background: #45a049;
}

.copy-link-btn svg {
    width: 18px;
    height: 18px;
}

.status-indicator {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.connected {
    background: #4caf50;
    color: white;
}

.status-indicator.error {
    background: #f44336;
    color: white;
}

.status-indicator.disconnected {
    background: #ff9800;
    color: white;
}

/* Chat Section */
.chat-section {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    background: #2a2a2a;
    border-left: 1px solid #3a3a3a;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    flex-shrink: 0;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #3a3a3a;
    background: #1a1a1a;
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 10px 12px;
    border-radius: 8px;
    background: #3a3a3a;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.own-message {
    background: #667eea;
    align-self: flex-end;
    max-width: 80%;
}

.chat-message.system-message {
    background: transparent;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 5px;
}

.message-name {
    font-weight: 600;
    margin-right: 5px;
}

.message-text {
    word-wrap: break-word;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #3a3a3a;
    display: flex;
    gap: 10px;
    background: #1a1a1a;
}

.chat-input-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #2a2a2a;
    color: white;
    font-size: 14px;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.send-btn:hover {
    background: #5568d3;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Responsive */
@media (max-width: 768px) {
    .room-container {
        flex-direction: column;
    }
    
    .video-section {
        margin-right: 0;
    }
    
    .controls-section {
        margin-right: 0;
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-section {
        width: 100%;
        height: 40vh;
        bottom: 0;
        top: auto;
        border-left: none;
        border-top: 1px solid #3a3a3a;
        position: relative;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

