/* Meeting Specific Styles */

/* Prevent Page Jump */

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Smooth Video Scaling */

.video-container video {
    transition: all 0.3s ease;
}

/* Fullscreen Video Layout */

.video-grid:has(.video-container:only-child) {
    grid-template-columns: 1fr !important;
}

.hidden {
    display: none !important;
}

/* Pre-join Screen */
.overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    background: var(--glass-bg);
}

.pre-join-card {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 450px;
    max-width: 90%;
    border: 1px solid var(--glass-border);
}

.pre-join-card h2 {
    margin-bottom: 20px;
}

.preview-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
    aspect-ratio: 16/9;
}

#previewVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror local video */
}

.preview-controls {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.name-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1rem;
    outline: none;
}

.name-input:focus {
    border-color: var(--primary-color);
}

.join-btn {
    width: 100%;
    justify-content: center;
}

/* Meeting Interface */
.meeting-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-color);
}

.video-area {
    flex: 1;
    width: 100%;
    height: calc(100vh - 100px);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.video-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    height: 100%;
    grid-auto-rows: 1fr;
    align-items: stretch;
    justify-items: stretch;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* PARTICIPANTS */

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    overflow-y: auto;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--glass-border);
}

.participant-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-container.local video {
    transform: scaleX(-1);
}

.user-label {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-mic-status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.user-mic-status.muted i {
    color: #ef4444;
}

/* Control Bar */
.control-bar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 100;
}

.meeting-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1.1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.main-controls {
    display: flex;
    gap: 15px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.control-btn.active {
    background: var(--glass-border);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.control-btn.active:hover {
    background: var(--glass-bg);
}

.control-btn:not(.active):not(.danger) {
    background: #ef4444;
    color: white;
}

.control-btn.danger {
    background: #ef4444;
    color: white;
    width: 60px;
    border-radius: 20px;
}

.control-btn.danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Side Panel (Chat) */
.side-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    bottom: 110px;
    width: 350px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.side-panel.hidden {
    transform: translateX(400px);
    opacity: 0;
    pointer-events: none;
}

.panel-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.close-panel {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    background: var(--glass-border);
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 85%;
    align-self: flex-start;
}

.chat-message.self {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
}

.chat-message .sender {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.chat-message.self .sender {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message .time {
    font-size: 0.7rem;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.panel-input {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--glass-border);
}

.panel-input input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 20px;
    color: var(--text-primary);
    outline: none;
}

.panel-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Tooltips */
.tooltip-container {
    position: relative;
}

.tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.tooltip-container:hover .tooltip {
    opacity: 1;
}

@media (max-width: 768px) {
    .control-bar {
        padding: 0 10px;
        margin: 0 10px 10px 10px;
    }

    .meeting-info {
        display: none;
    }

    .side-panel {
        right: 10px;
        top: 10px;
        bottom: 100px;
        width: calc(100% - 20px);
    }
}

#recordBtn.active {

    background: #ef4444 !important;

    color: white !important;

    animation: pulseRecord 1s infinite;

}

@keyframes pulseRecord {

    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }

}