/* General styles */

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* ✅ Hides both vertical & horizontal scrollbars */
    display: flex;
    flex-direction: row; /* Aligns controls on the left */
    height: 100vh;
    width: 100vw; /* ✅ Ensures full width */
    background-color: #111;
    color: white;
    font-family: Arial, sans-serif;
}

/* Controls Section (Left-side column with title) */
.controls {
    width: 10vw; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background-color: #222;
    border-right: 2px solid #444;
    height: 100vh;
}

/* Title */
.controls h1 {
    margin: 0;
    font-size: 20px;
    color: white;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #444; /* Adds a subtle divider */
    width: 100%;
}

/* Room Input */
.room-input {
    width: 80%;
    padding: 10px;
    font-size: 14px;
    text-align: center;
}

/* Buttons */
button {
    width: 100%;
    padding: 5px;
    font-size: 14px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
}

button:hover {
    background-color: #0056b3;
}

/* Video Container */
.video-container {
    flex-grow: 1; /* Allows the main video to take up remaining space */
    display: flex;
    justify-content: left;
    align-items: center;
    background-color: black;
    padding: 10px;
}

/* Main video (remote stream) */
#remote-video {
    width: 70vw;
    height: 90vh;
    position: fixed;
    top: 10px;
    object-fit: cover;
    border-radius: 10px;
    background-color: #222;
    aspect-ratio: 16/9; /* Ensures smooth resizing */
}

/* Local webcam (mini window) - Positioned outside main container */
#local-video {
    width: 15vw;
    height: auto; /* Automatically adjusts based on aspect ratio */
    aspect-ratio: 1 / 1; /* Keeps width and height equal */
    object-fit: cover;
    position: fixed; /* Floats outside the main video */
    top: 10px;  
    right: 10px;
    border-radius: 10px;
    border: 2px solid white;
    background-color: black;
    box-shadow: 2px 2px 10px rgba(255, 255, 255, 0.3); /* Slight shadow effect */
}

.how-to-use {
    font-size: 16px;
    color: white; /* White text for the "How to Use" link */
    cursor: pointer;
    text-decoration: underline;
    z-index: 1;
}

/* Modal Style */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Black background with transparency */
}

/* Modal content */
.modal-content {
    background-color: white;
    color: black; /* Black text for modal content */
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
}

/* Close button */
.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Chat Container - Fixed Height */
#chat-container {
    position: fixed;
    right: 10px;
    top: calc(30px + 15vw + 10px); /* Below the local webcam */
    width: calc(15vw - 15px);
    height: calc(90vh - (25vw + 20px)); /* ✅ FIXED HEIGHT */
    background-color: #222;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 2px 2px 10px rgba(255, 255, 255, 0.3);
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* ✅ Prevents unexpected growth */
}

/* Chat Messages - Scroll Instead of Expanding */
#chat-messages {
    flex-grow: 1;
    overflow-y: auto; /* ✅ Ensures messages scroll instead of resizing */
    padding: 10px;
    max-height: 75%; /* ✅ Adjusted to prevent overflow */
    background-color: #333;
    border-radius: 5px;
}

/* Chat Input Container */
.chat-input-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding-top: 10px;
}

/* Input Field */
#chat-input {
    flex-grow: 1;
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid white;
    border-radius: 5px;
    background-color: #444;
    color: white;
    box-sizing: border-box;
}

/* ✅ Chat Icons Row - Reversed Order */
.chat-icons-container {
    display: flex;
    justify-content: center; /* ✅ Centers the icons */
    gap: 15px; /* ✅ Space between icons */
    padding-top: 8px;
    padding-bottom: 8px;
    height: 40px; /* ✅ Fixed height */
    border-top: 2px solid #555; /* ✅ Creates separation */
    background-color: #282828; /* ✅ Makes it stand out */
    flex-direction: row-reverse; /* ✅ Reverses the order */
}

/* Chat Icons */
.chat-icon {
    cursor: pointer;
    font-size: 18px; /* ✅ Bigger size */
    color: white;
    width: 24px; /* ✅ Ensures visibility */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #444; /* ✅ Visible background */
    border-radius: 50%; /* ✅ Circular buttons */
    transition: 0.3s;
}

/* Hover Effect */
.chat-icon:hover {
    color: #00aaff;
    background-color: #555;
}

/* Hide Default File Input */
#file-input {
    display: none;
}

