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

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #22c55e;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

#app {
    min-height: 100vh;
}

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

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

.container {
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-buttons .btn {
    width: 100%;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: 0.5rem;
}

.feature .icon {
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Security note */
.security-note {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Link box */
.link-box {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.link-box input {
    flex: 1;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 0.875rem;
}

/* Waiting indicator */
.waiting-indicator {
    margin: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Join screen */
.join-info {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Error message */
.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 0.5rem;
    color: var(--danger-color);
}

.hidden {
    display: none !important;
}

/* Call screen */
#call-screen {
    padding: 0;
}

#call-screen.active {
    display: block;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
}

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

#local-video {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
}

.encryption-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid var(--success-color);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--success-color);
}

.call-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--border-color);
}

.control-btn.disabled {
    background: var(--danger-color);
}

.btn-hangup {
    background: var(--danger-color);
    transform: rotate(135deg);
}

.btn-hangup:hover {
    background: var(--danger-hover);
}

.connection-status {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--surface-color);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #local-video {
        width: 120px;
        height: 90px;
        bottom: 100px;
        right: 10px;
    }
    
    .link-box {
        flex-direction: column;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}
