/* Omegle-style Chat Specifics */

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

.chat-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.chat-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.chat-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.status {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 50px;
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    font-size: 0.9rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.status.connected {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

.status.searching {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
    }
}

.video-chat-container {
    border-radius: 1rem;
    color: var(--card-foreground, #1e293b);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    padding: clamp(20px, 5vw, 40px);
    flex: 1;
    min-width: 280px;
}

.video-row {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.video-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16/9;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex: 1;
    min-width: 150px;
}

.video-box label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    z-index: 10;
}

.camera-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

#muteBtn,
#camBtn {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#muteBtn:hover,
#camBtn:hover {
    background: rgba(0, 0, 0, 0.8);
}

#reportBtn {
    background: rgba(255, 0, 0, 0.6);
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#reportBtn:hover {
    background: rgba(255, 0, 0, 0.8);
}

.video-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.controls {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.controls button {
    padding: clamp(10px, 2vw, 12px) clamp(16px, 4vw, 25px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

#startBtn {
    background: linear-gradient(45deg, #6366f1, #a855f7);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
}

#stopBtn {
    background: #ef4444;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

#stopBtn:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

#nextBtn {
    background: #334155;
    box-shadow: 0 5px 15px rgba(51, 65, 85, 0.3);
}

#nextBtn:hover:not(:disabled) {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(51, 65, 85, 0.4);
}

.controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stranger-chat-container {
    border-radius: 1rem;
    color: var(--card-foreground, #1e293b);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
    min-height: 500px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 280px;
}

.stranger-chat-wrapper {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stranger-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.stranger-chat-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stranger-chat-title-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #6366f1;
}

.stranger-chat-title {
    font-weight: 600;
    color: #1e293b;
}

.stranger-chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
}

.msg.local {
    align-self: flex-end;
    background-color: #e0e7ff;
    color: #1e293b;
}

.msg.remote {
    align-self: flex-start;
    background-color: #f1f5f9;
    color: #1e293b;
}

.stranger-chat-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stranger-chat-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 2.5rem;
    border-radius: 0.375rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: 100%;
    color: #ffffff;
    background: linear-gradient(to right, #6366f1, #a855f7);
}

.stranger-chat-start-button:hover {
    background: linear-gradient(to right, #4f46e5, #9333ea);
}

.stranger-chat-start-button:focus-visible {
    box-shadow: 0 0 0 2px var(--ring, #a855f7);
}

.stranger-chat-start-button:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.stranger-chat-button-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    pointer-events: none;
    flex-shrink: 0;
}

.stranger-chat-input-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stranger-chat-input {
    flex: 1;
    height: 2.25rem;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    background: transparent;
    padding: 0 0.75rem;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stranger-chat-input:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.stranger-chat-send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    background-color: #6366f1;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.stranger-chat-send-button:hover {
    background-color: #4f46e5;
}


/* Responsive Adjustments */

@media (max-width: 1024px) {
    .chat-container {
        flex-direction: column;
        gap: 20px;
    }
    .video-chat-container,
    .stranger-chat-container {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .chat-container {
        margin: 10px;
        padding: 10px;
        gap: 15px;
    }
    .chat-header h1 {
        font-size: 1.8rem;
    }
    .video-chat-container,
    .stranger-chat-container {
        padding: clamp(15px, 4vw, 25px);
    }
    .video-row {
        gap: 10px;
        margin-bottom: 15px;
    }
    .video-box {
        max-width: 100%;
        aspect-ratio: 16/9;
    }
    .controls {
        gap: 10px;
    }
    .controls button {
        min-width: 120px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    .message {
        max-width: 90%;
        font-size: 0.9rem;
    }
    .stranger-chat-messages {
        max-height: 250px;
        margin-bottom: 10px;
    }
    .stranger-chat-start-button {
        font-size: 0.8rem;
        height: 2.25rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    .chat-header h1 {
        font-size: 1.5rem;
    }
    .chat-container {
        margin: 5px;
        padding: 5px;
        gap: 10px;
    }
    .video-chat-container,
    .stranger-chat-container {
        padding: 15px;
        max-width: 100%;
    }
    .video-row {
        gap: 8px;
        margin-bottom: 12px;
    }
    .video-box {
        max-width: 100%;
        aspect-ratio: 16/9;
    }
    .video-box label {
        top: 8px;
        left: 8px;
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    .controls {
        gap: 8px;
    }
    .controls button {
        width: 48%;
        min-width: unset;
        font-size: 0.75rem;
        padding: 8px 10px;
    }
    .status {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    .stranger-chat-container {
        min-height: 400px;
        max-height: 500px;
    }
    .stranger-chat-wrapper {
        padding: 1rem;
    }
    .stranger-chat-messages {
        max-height: 200px;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    .stranger-chat-start-button {
        padding: 0.75rem;
        font-size: 0.75rem;
        height: 2rem;
    }
    .message {
        max-width: 95%;
        font-size: 0.85rem;
    }
    .chat-form {
        flex-direction: column;
        gap: 8px;
    }
    .chat-form input,
    .chat-form button {
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .chat-header h1 {
        font-size: 1.2rem;
    }
    .controls button {
        width: 100%;
        margin-bottom: 4px;
    }
    .video-box label {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}