/* assets/css/style.css - Version 3.4 FINAL */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6; margin: 0; padding: 20px;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; color: #333;
}
.auth-container, .dashboard-container {
    background: #fff; padding: 30px; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 100%; max-width: 400px;
}
.dashboard-container.wide { max-width: 1000px; }
h2, h3 { color: #2c3e50; }
h3 { margin-top: 0; }
a { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
button, .btn-join {
    width: 100%; padding: 12px; border: none; background-color: #3498db;
    color: white; border-radius: 4px; cursor: pointer; font-size: 16px;
    margin-top: 10px; display: inline-block; text-align: center; box-sizing: border-box;
}
button:hover, .btn-join:hover { background-color: #2980b9; text-decoration: none; color: white; }
.error { color: #e74c3c; margin-top: 15px; min-height: 20px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.logout-btn { background-color: #e74c3c; color: white; padding: 8px 15px; border-radius: 4px; font-size: 14px; }
.logout-btn:hover { background-color: #c0392b; }
.dashboard-content { display: flex; gap: 30px; }
.dashboard-actions { flex: 1; }
.action-card { padding: 20px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 20px; }
.meeting-list-container { flex: 1.5; }
#meeting-list { list-style: none; padding: 0; margin: 0; }
#meeting-list li { display: flex; justify-content: space-between; align-items: center; padding: 15px; border: 1px solid #eee; border-radius: 5px; margin-bottom: 10px; }
.meeting-info { display: flex; flex-direction: column; gap: 5px; }
.meeting-title { font-weight: 600; }
.meeting-id-display { font-size: 12px; color: #555; background: #f0f0f0; padding: 2px 5px; border-radius: 3px; }
.meeting-lock { font-size: 14px; }
.meeting-buttons { display: flex; gap: 10px; }
.meeting-buttons .btn-join, .meeting-buttons .btn-delete { width: auto; padding: 8px 12px; font-size: 14px; margin-top: 0; }
.meeting-buttons .btn-delete { background-color: #bdc3c7; }
.meeting-buttons .btn-delete:hover { background-color: #95a5a6; }

/* --- Meeting Page Layout --- */
.meeting-container { width: 100%; max-width: 1600px; height: 90vh; display: flex; flex-direction: column; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.main-content { display: flex; flex: 1; min-height: 0; }
.video-section { flex: 3; display: flex; flex-direction: column; background: #2c3e50; }
.sidebar { flex: 1; display: flex; flex-direction: column; border-left: 1px solid #eee; min-width: 280px; }

/* === MODIFIED: Thumbnail Strip is now on top === */
.thumbnail-videos-container {
    /* order: 1; */ /* Not needed due to HTML order */
    height: 120px;
    background-color: #233140;
    padding: 10px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}

/* === MODIFIED: Main Video Area is below thumbnail === */
.main-video-container {
    /* order: 2; */ /* Not needed due to HTML order */
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Gallery View */
.gallery-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; width: 100%; height: 100%; align-content: flex-start; overflow-y: auto; }

/* Single Video Player Styling */
.video-player-container, .name-card {
    position: relative; background-color: #000; border-radius: 8px;
    overflow: hidden; border: 2px solid transparent; transition: border-color 0.2s;
    cursor: pointer; aspect-ratio: 16 / 9;
}
.video-player-container.focused { border-color: #3498db; cursor: default; }
.video-player-container.thumbnail { width: 160px; height: 90px; flex-shrink: 0; }
.video-player-container.main {
    width: 100%; height: 100%;
    /* Recalculate max-width based on available height after thumbnail strip */
    max-width: calc((100vh - 120px - 70px - 40px) * 1.777); 
    max-height: 100%;
    margin: auto;
    cursor: default;
    aspect-ratio: 16/9;
}
video { width: 100%; height: 100%; object-fit: cover; }
.video-player-container.screen-share video { object-fit: contain; }

.video-label {
    position: absolute; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.5);
    color: white; padding: 5px 10px; font-size: 14px; width: 100%; box-sizing: border-box;
}

/* Name Card */
.name-card {
    display: flex; justify-content: center; align-items: center;
    background-color: #34495e; color: white; font-size: 24px; font-weight: bold;
}

/* Volume Control */
.volume-control {
    position: absolute; top: 10px; left: 10px;
    display: flex; align-items: center; opacity: 0;
    transition: opacity 0.3s; background: rgba(0, 0, 0, 0.5);
    padding: 5px; border-radius: 5px;
}
.video-player-container:hover .volume-control { opacity: 1; }
.volume-control span { color: white; font-size: 16px; margin-right: 5px; }
.volume-control input[type="range"] { width: 80px; cursor: pointer; }

/* === MODIFIED: Controls Bar is now at the bottom === */
.controls-bar {
    /* order: 3; */ /* Not needed due to HTML order */
    padding: 10px; background-color: #f8f9fa; border-top: 1px solid #ddd;
    display: flex; justify-content: center; gap: 15px; flex-wrap: wrap;
}
.control-btn { width: auto; padding: 10px 20px; font-size: 14px; border: 1px solid #ccc; background-color: #fff; margin-top: 0; }
.control-btn:hover { background-color: #e9ecef; }
.control-btn.active { background-color: #e74c3c; color: #fff; border-color: #e74c3c; }

/* Sidebar */
.participants-container { padding: 15px; border-bottom: 1px solid #eee; }
#participant-list { list-style: none; padding: 0; margin-top: 10px; font-size: 14px; }
#participant-list li { padding: 5px 0; }
.chat-container { flex: 1; display: flex; flex-direction: column; padding: 15px; min-height: 0; }
#chat-box { flex: 1; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; padding: 10px; overflow-y: auto; }
.chat-message { margin-bottom: 10px; word-wrap: break-word; }
.chat-message strong { color: #3498db; }
.chat-input { display: flex; }
#chat-message-input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; }
#send-chat-btn { padding: 10px 15px; border-radius: 0 4px 4px 0; margin-top: 0; }