/* ================= Base Page Setup ================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #e8fdf5; /* Mint Green */
    color: white;
    min-height: 100vh;
}

/* ================= Header / Navbar Styling ================= */
header {
    background-color: #0b1a30;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-dot {
    width: 24px;
    height: 24px;
    background-color: #5ce1b6; /* Mint green */
    border-radius: 50%;
}

.logo-text {
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: white;
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 6px;
}

nav a:hover, nav a.active {
    color: #5ce1b6;
    background-color: rgba(92, 225, 182, 0.08);
}

.auth-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-icon {
    width: 38px;
    height: 38px;
    background-color: #cbd5e1;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.profile-icon:hover {
    background-color: #5ce1b6;
}

.profile-icon svg {
    width: 22px;
    height: 22px;
    fill: #475569;
}

.user-greeting {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-right: 5px;
    display: none; /* Hidden by default until logged in */
}

.sign-in-btn {
    background-color: #4a7c74;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.sign-in-btn:hover {
    background-color: #5ce1b6;
    color: #0b1a30;
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    nav a {
        padding: 6px 12px;
        font-size: 0.88rem;
    }
}

/* ================= Two-Column Page Layout ================= */
.page-container {
    max-width: 1100px;
    width: 100%;
    margin: 50px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); /* Responsive side-by-side, prevents columns overflowing */
    gap: 30px;
}

/* General Card Design */
.card {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    width: 100%;
    min-width: 0; /* lets card shrink inside grid instead of forcing overflow */
}

.card-text {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 15px;
}

.card-subtext {
    color: #000000;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

/* ================= View & Toggle Configurations ================= */
.view-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.view-content.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

/* Initial Button Styling */
.start-group-btn {
    background-color: #4a7c74;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    padding: 14px 35px;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.start-group-btn:hover {
    background-color: #004fff;
    color: #ffffff;
}

/* ================= Creation Form Layout ================= */
.form-title {
    color: #000000;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background-color: #ffffff;
    border: 2px solid #1e293b;
    border-radius: 12px;
    color: black;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group textarea {
    resize: none;
    font-family: Arial, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #5ce1b6;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.half-width {
    flex: 1 1 200px;
    min-width: 0;
}

.form-group input[type="datetime-local"] {
    min-width: 0;
    width: 100%;
}

/* Form Buttons Styling */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

.submit-btn {
    background-color: #63e6b4;
    color: #000000;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #4fe0a5;
}

.cancel-btn {
    background-color: transparent;
    color: #94a3b8;
    border: 2px solid #1e293b;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

/* ================= Right-Side Instruction Card Styling ================= */
.instruction-card {
    border-left: 5px solid #5ce1b6;
}

.instruction-list {
    list-style: none;
    padding: 0;
    margin: 25px 0 0 0;
}

.instruction-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    color: #000000;
    font-size: 0.95rem;
    line-height: 1.5;
}

.instruction-list span {
    background-color: #5ce1b6;
    color: #0b1528;
    font-weight: 800;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* ================= Responsive Adjustment ================= */
@media (max-width: 800px) {
    .page-container {
        grid-template-columns: minmax(0, 1fr);
        margin: 30px auto;
        padding: 0 16px;
        gap: 20px;
    }
    .card {
        padding: 24px;
    }
}

/* Modals Basic Layout Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(11, 26, 48, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
}
.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover {
    color: #475569;
}
.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #0b1a30;
    font-size: 1.5rem;
}
.modal-submit-btn {
    width: 100%;
    background-color: #5ce1b6;
    color: #0b1a30;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}
.modal-submit-btn:hover {
    background-color: #4cd2a7;
}
.modal-footer-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #64748b;
}
.modal-footer-link a {
    color: #5ce1b6;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}
.modal-footer-link a:hover {
    text-decoration: underline;
}
/* =========================================
   PROFILE DROPDOWN MENU STYLES
   ========================================= */

.profile-dropdown-container {
    position: relative;
    display: inline-block;
    margin-left: 15px; /* Adds space between nav links and profile icon */
}

/* The Circular Profile Button */
.profile-dropdown-btn {
    background-color: #cbd5e1; /* Light gray-blue background */
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: filter 0.2s;
}

.profile-dropdown-btn:hover {
    filter: brightness(0.9);
}

.profile-dropdown-btn svg {
    fill: #475569; /* Dark gray for the person icon */
    width: 24px;
    height: 24px;
}

/* The Dropdown Box (Hidden by default) */
.dropdown-menu {
    display: none; /* Controlled by JavaScript class .show */
    position: absolute;
    right: 0;
    top: 60px; /* Distance from top */
    background-color: #ffffff;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    text-align: left;
}

/* When JavaScript adds the 'show' class, display the menu */
.dropdown-menu.show {
    display: block;
}

/* Header inside dropdown (Name and Email) */
.dropdown-header {
    padding: 16px;
    background-color: #ffffff;
}

.dropdown-header strong {
    display: block;
    color: #0f172a; /* Dark blue/black for Name */
    font-size: 16px;
    margin-bottom: 4px;
}

.dropdown-sub {
    display: block;
    color: #3b82f6; /* Blue color for Email */
    font-size: 14px;
}

/* Divider line */
.dropdown-menu hr {
    margin: 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* Links inside the dropdown */
.dropdown-item {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8fafc;
}

/* Specific style for Sign Out button */
.logout-item {
    color: #ef4444; /* Red color */
}

.logout-item:hover {
    background-color: #fef2f2; /* Light red background on hover */
}