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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

#app {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.screen.active {
    display: block;
}

/* Start Screen */
.start-content {
    padding: 60px 40px;
    text-align: center;
}

.start-content h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #333;
}

.start-content input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    margin: 20px auto;
    display: block;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.start-content input:focus {
    outline: none;
    border-color: #667eea;
}

/* Waiting Screen */
.waiting-content {
    padding: 60px 40px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waiting-content h2 {
    margin-bottom: 15px;
    color: #333;
}

.waiting-content p {
    margin-bottom: 30px;
    color: #666;
}

/* Chat Screen */
#chat-screen {
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.video-container {
    position: relative;
    background: #000;
    height: 50%;
    display: flex;
}

#local-video {
    width: 30%;
    height: 100%;
    object-fit: cover;
    border-right: 2px solid #333;
}

#remote-video {
    width: 70%;
    height: 100%;
    object-fit: cover;
}

.status {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.chat-container {
    height: 35%;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #ddd;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
}

.message.own {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.other {
    background: #e9ecef;
    color: #333;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    margin-right: 10px;
    font-size: 1rem;
}

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

.controls {
    padding: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    background: #f8f9fa;
}

/* Disconnected Screen */
.disconnected-content {
    padding: 60px 40px;
    text-align: center;
}

.disconnected-content h2 {
    margin-bottom: 15px;
    color: #333;
}

.disconnected-content p {
    margin-bottom: 30px;
    color: #666;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn.primary {
    background: #667eea;
    color: white;
}

.btn.secondary {
    background: #6c757d;
    color: white;
}

.btn.warning {
    background: #ffc107;
    color: #333;
}

.btn.danger {
    background: #dc3545;
    color: white;
}

.btn.control {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #chat-screen {
        height: 90vh;
    }
    
    .video-container {
        flex-direction: column;
        height: 40%;
    }
    
    #local-video, #remote-video {
        width: 100%;
        height: 50%;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .start-content, .waiting-content, .disconnected-content {
        padding: 40px 20px;
    }
}