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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 36px;
}

h2 {
    color: white;
    margin: 0;
}

h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

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

.input-large {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    outline: none;
}

.input-large:focus {
    border-color: #667eea;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.error {
    color: red;
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
}

/* Chat Screen */
#chatScreen {
    display: none;
    flex-direction: column;
}

#chatScreen.active {
    display: flex;
}

.header {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.btn-logout {
    padding: 10px 20px;
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.main-content {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
}

.video-section {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

#localVideo, #remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#localVideo {
    position: absolute;
    width: 150px;
    height: 150px;
    bottom: 20px;
    right: 20px;
    border: 3px solid white;
    border-radius: 10px;
    z-index: 10;
}

.call-controls {
    text-align: center;
}

.btn-call {
    padding: 20px 40px;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-call {
    background: #4CAF50;
    color: white;
}

.btn-call:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-end {
    background: #f44336;
}

.btn-end:hover {
    background: #da190b;
}

.messages-section {
    flex: 1;
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 500px;
}

.message {
    margin-bottom: 15px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 10px;
}

.message.sent {
    background: #667eea;
    color: white;
    text-align: right;
}

.message-sender {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}

.message-text {
    font-size: 16px;
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex: 1;
}

.btn-send {
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

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