/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0a0a14;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 0%, #1a1040 0%, #0a0a14 70%);
}

.app-container {
    width: 100%;
    max-width: 1280px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 700;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.room-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.input-field {
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 15px;
    outline: none;
    min-width: 180px;
    transition: all 0.3s ease;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-field:focus {
    border-color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(168, 85, 247, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(52, 211, 153, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(239, 68, 68, 0.4);
}

.btn-icon {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 20px;
    min-width: 56px;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.btn-icon.active {
    background: rgba(52, 211, 153, 0.2);
    border-color: #34d399;
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.1);
}

.btn-icon.inactive {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.1);
}

/* ===== NOISE REDUCTION ===== */
.btn-icon.noise-active {
    background: rgba(168, 85, 247, 0.25);
    border-color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
    animation: pulse-noise 2s ease-in-out infinite;
}

@keyframes pulse-noise {
    0%, 100% {
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
    }
    50% {
        box-shadow: 0 0 50px rgba(168, 85, 247, 0.3);
    }
}

/* ===== VIDEO GRID ===== */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 55vh;
    min-height: 380px;
    margin-bottom: 25px;
}

.video-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.4s ease;
}

.video-wrapper:hover {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.05);
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0a0a14;
}

/* ===== VIDEO LABELS ===== */
.video-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 2;
}

.label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

.local-dot {
    background: #34d399;
}

.remote-dot {
    background: #60a5fa;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* ===== VIDEO PLACEHOLDER ===== */
.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1;
    transition: opacity 0.5s ease;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.placeholder-icon {
    font-size: 48px;
    opacity: 0.6;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(168, 85, 247, 0.1);
    border-top: 3px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.controls .btn {
    font-size: 14px;
}

.controls .btn .icon {
    font-size: 20px;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* ===== STATUS BAR ===== */
.status-bar {
    flex: 1;
    padding: 12px 24px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.4s ease;
    min-width: 200px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.4s ease;
}

.status-dot.idle {
    background: #64748b;
}
.status-dot.connecting {
    background: #f59e0b;
    animation: pulse-dot 1s ease-in-out infinite;
}
.status-dot.connected {
    background: #34d399;
}
.status-dot.error {
    background: #ef4444;
}

/* ===== LANGUAGE SELECTOR ===== */
.language-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.lang-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 25px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    box-shadow: 0 2px 15px rgba(168, 85, 247, 0.3);
}

.lang-btn:active {
    transform: scale(0.95);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-wrapper {
    animation: fadeInUp 0.6s ease forwards;
}

.video-wrapper:nth-child(2) {
    animation-delay: 0.2s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .app-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
        border-radius: 20px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .logo {
        font-size: 22px;
        justify-content: center;
    }

    .room-controls {
        flex-direction: column;
        width: 100%;
    }

    .room-controls .input-field {
        width: 100%;
        min-width: unset;
    }

    .room-controls .btn {
        width: 100%;
        justify-content: center;
    }

    .video-grid {
        grid-template-columns: 1fr;
        height: 50vh;
        min-height: 300px;
        gap: 12px;
    }

    .controls {
        gap: 10px;
    }

    .controls .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-icon {
        padding: 12px 14px;
        min-width: 48px;
    }

    .video-label {
        font-size: 12px;
        padding: 6px 14px;
        bottom: 12px;
        left: 12px;
    }

    .footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .status-bar {
        font-size: 13px;
        padding: 10px 16px;
        min-width: unset;
    }

    .language-selector {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 12px;
    }

    .video-grid {
        height: 40vh;
        min-height: 250px;
    }

    .controls .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .btn-icon {
        padding: 10px 12px;
        min-width: 42px;
        font-size: 16px;
    }

    .lang-btn {
        padding: 4px 12px;
        font-size: 12px;
    }
}