/* ============ Global Styles ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --light-bg: #f3f4f6;
    --text-dark: #111827;
    --text-light: #6b7280;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* ============ Home Page Styles ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.home-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.action-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
}

.action-card .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.action-card h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.action-card p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
    transform: scale(1.05);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #059669;
    transform: scale(1.05);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 5px;
    font-weight: bold;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    display: none;
    margin-top: 10px;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ============ Call Page Styles ============ */
.call-page {
    background: var(--dark-bg);
    overflow: hidden;
}

.room-info-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    z-index: 100;
}

.room-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-code-display .code {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.call-duration {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.participants-count {
    font-size: 1.2rem;
}

.video-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 100px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.remote-video {
    grid-row: 1;
}

.local-video {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 250px;
    height: 180px;
    z-index: 50;
    border: 2px solid white;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.placeholder-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.video-label {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.call-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 100;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.control-btn .icon {
    font-size: 1.8rem;
}

.control-btn .label {
    font-size: 0.7rem;
    font-weight: 600;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn.disabled {
    background: rgba(239, 68, 68, 0.3);
}

.control-btn.end-call {
    background: var(--danger-color);
}

.control-btn.end-call:hover {
    background: #dc2626;
}

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--secondary-color);
}

.notification.error {
    background: var(--danger-color);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ Responsive Styles ============ */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .home-content {
        grid-template-columns: 1fr;
    }
    
    .local-video {
        width: 120px;
        height: 90px;
        bottom: 110px;
        right: 10px;
    }
    
    .call-controls {
        gap: 10px;
        padding: 15px 10px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
    }
    
    .control-btn .icon {
        font-size: 1.5rem;
    }
    
    .room-code-display .code {
        font-size: 1.2rem;
    }
}
