@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #42829d;
    --primary-hover: #5292b1;
    --secondary-color: #e0e0e0;
    --secondary-hover: #cccccc;
    --text-light: #f8f9fa;
    --text-dark: #343a40;
    --bg-light: #ffffff;
    --bg-dark: #121212;
    --bg-dark-secondary: #1e1e1e;
    --border-light: #dee2e6;
    --border-dark: #333;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* --- Dark Mode --- */
html.dark-mode body { /* Changed selector */
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* --- Reusable Components --- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none; /* Removes underline from <a> tags */
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.button-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}
.button-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.button-secondary {
    background-color: transparent;
    color: var(--text-dark);
    border-color: var(--border-light);
}
.button-secondary:hover {
    background-color: var(--secondary-color);
}

html.dark-mode .button-secondary { /* Changed selector */
    color: var(--text-light);
    border-color: var(--border-dark);
}
html.dark-mode .button-secondary:hover { /* Changed selector */
    background-color: var(--bg-dark-secondary);
}

/* --- Header --- */
.main-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 2rem;
    height: 56px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 100;
}
html.dark-mode .main-header { /* Changed selector */
    border-bottom-color: var(--border-dark);
    background-color: var(--bg-dark-secondary);
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-self: start;
    grid-column: 1;
}
.header-logo {
    height: 35px;
}
.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    grid-column: 2;
}
.main-nav a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: inherit;
}

/* Styles for the new user profile dropdown */
.user-profile-dropdown {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1rem;
    grid-column: 3;
}

/* Updated profile photo size and containment */
.user-profile-photo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #fff;
}

.user-profile-photo:hover {
    border-color: var(--primary-color);
}

.guest-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile-menu {
    position: absolute;
    top: 56px;
    right: 0;
    background-color: var(--bg-light); /* Light mode default */
    border: 1px solid var(--border-light); /* Light mode default */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 10px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 10px;
}
html.dark-mode .user-profile-menu { /* Changed selector */
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html.dark-mode #notification-dropdown {
    background-color: var(--bg-dark-secondary) !important; /* Use !important to override Tailwind */
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.dark-mode-toggle:hover {
    background-color: var(--secondary-color);
}
html.dark-mode .dark-mode-toggle:hover { /* Changed selector */
    background-color: #333;
}

/* Add spacing between the dark mode icon and text */
.dark-mode-toggle i {
    margin-right: 0.5rem; /* 8px */
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}
.menu-item-link:hover {
    background-color: var(--secondary-color);
}
html.dark-mode .menu-item-link:hover { /* Changed selector */
    background-color: #333;
}

/* Basic switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-left: 0.75rem; /* Add space between text and slider */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Modal container */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
}

/* Modal content */
.modal-content {
    background-color: var(--bg-light);
    margin: 15% auto; 
    padding: 2rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

html.dark-mode .modal-content { 
    background-color: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}

.modal .button.secondary {
    background-color: #f1f1f1;
    color: #555;
    border: 1px solid #ddd;
}
.modal .button.secondary:hover {
    background-color: #e9e9e9;
}

html.dark-mode .modal .button.secondary {
    background-color: #555;
    color: #eee;
    border-color: #666;
}
html.dark-mode .modal .button.secondary:hover {
    background-color: #666;
}

.modal-content input {
    width: 80%;
    padding: 0.5rem;
    margin: 1rem 0;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

html.dark-mode .modal-content input {
    background-color: #3c3c3c;
    color: #e0e0e0;
    border-color: #555;
}
.modal-content h3 {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#roomCodeInput {
    width: 240px; /* Fixed width for a 6-char code input */
    margin-left: auto;
    margin-right: auto;
    display: block;
    
    text-align: center;
    font-size: 2.25rem; /* Larger font size: 36px */
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.3em; /* Space out the letters */
    text-transform: uppercase;
    padding-left: 0.3em; /* Balance letter-spacing */
    
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-width: 1px;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#roomCodeInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 130, 157, 0.3);
}

html.dark-mode .modal-content h3 {
    color: var(--text-light);
}

html.dark-mode #roomCodeInput {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
    color: var(--text-light);
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.2);
}

html.dark-mode #roomCodeInput:focus {
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgba(82, 146, 177, 0.4);
}


/* Close button for Join Room Modal */
#closeModal {
    position: absolute;
    top: 5px;   /* reduce from 10px */
    right: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 2100;
}

#closeModal:hover {
    color: #ff0000; /* Red on hover */
}

html.dark-mode #closeModal { /* Changed selector */
    color: #f8f9fa;
}

html.dark-mode #closeModal:hover { /* Changed selector */
    color: #ff4d4d;
}


/* Dark mode overrides */
html.dark-mode .slider { /* Changed selector */
    background-color: #555;
}

html.dark-mode input:checked + .slider { /* Changed selector */
    background-color: var(--primary-color);
}

/* --- Section Styling --- */
section {
    padding: 4rem 2rem;
    text-align: center;
}
section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.bg-alt {
    background-color: #f8f9fa;
}
html.dark-mode .bg-alt {
    background-color: var(--bg-dark-secondary);
}


/* --- Hero Section --- */
.hero-section {
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-logo {
    max-width: 400px;
    margin-bottom: 2rem;
}
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.hero-content .subtitle {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 2.5rem;
}
html.dark-mode .hero-content .subtitle { /* Changed selector */
    color: #adb5bd;
}
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- How It Works Section --- */
.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 3rem auto 0;
}
.step-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.step h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 3rem auto 0;
    text-align: left;
}
.feature-card {
    background: var(--bg-light);
    padding: 2rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
html.dark-mode .feature-card { /* Changed selector */
    background: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}
.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* --- Team Section --- */
.team-subtitle {
    max-width: 600px;
    margin: 0 auto 3rem;
}
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}
/* **** START: TEXT ALIGNMENT FIX **** */
.team-member {
    width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* **** END: TEXT ALIGNMENT FIX **** */
.team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--border-light);
}
html.dark-mode .team-member img { /* Changed selector */
    border-color: var(--border-dark);
}
.team-member h3 {
    margin-bottom: 0.25rem;
}

/* --- Pricing Section --- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 3rem auto 0;
    align-items: center;
}
.pricing-tier {
    background: var(--bg-light);
    padding: 2rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
html.dark-mode .pricing-tier { /* Changed selector */
    background: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}
.pricing-tier.popular {
    border-color: var(--primary-color);
    transform: scale(1.05);
    position: relative;
}
.pricing-tier.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}
.pricing-tier .price {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
    display: inline-flex;
    align-items: flex-start;
    line-height: 1;
}
.pricing-tier .price span {
    font-size: 1.5rem;
    font-weight: 600;
    margin-right: 0.25rem;
    position: relative;
    top: 0.25rem;
}
.pricing-tier .price-desc {
    margin-bottom: 2rem;
}
.pricing-tier ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-bottom: 2rem;
}
.pricing-tier ul li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pricing-tier ul li .fa-check {
    color: #28a745;
}
.pricing-tier .price-tag {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
    padding: 0.6rem 0;
}
.pricing-tier .button.disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* --- Footer --- */
.main-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-light);
}
html.dark-mode .main-footer { /* Changed selector */
    border-top-color: var(--border-dark);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-header {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .main-nav {
        flex-direction: column; /* Stack nav links */
        align-items: center;
        width: 100%;
        gap: 0;
    }
    .user-profile-dropdown {
        display: flex;
        flex-direction: column; /* Stack user icon and login button */
        align-items: center;
        width: 100%;
        gap: 0.5rem;
    }
    .user-profile-dropdown .button {
        width: 100%;
    }
    section h2 {
        font-size: 2rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .steps-container, .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-tier.popular {
        transform: scale(1);
    }
}
/* Add this to src/static/css/index.css */

/* Navigation separator */
.nav-separator {
    color: var(--text-dark);
    margin: 0 0.5rem;
    font-weight: 300;
}

html.dark-mode .nav-separator {
    color: var(--text-light);
}

/* Navigation Login Dropdown */
.nav-login-dropdown {
    position: relative;
    display: inline-block;
}

.nav-login-dropdown > a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    cursor: pointer;
}

.nav-login-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
}

html.dark-mode .nav-login-menu {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-login-menu.show {
    display: block;
}

.nav-login-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

html.dark-mode .nav-login-button {
    color: var(--text-light);
}

.nav-login-button:hover {
    background-color: var(--secondary-color);
}

html.dark-mode .nav-login-button:hover {
    background-color: #333;
}

.nav-login-button i {
    font-size: 1.1rem;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /* Light Mode Default */
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    
    padding: 12px 24px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s ease;
    z-index: 9999;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

html.dark-mode .toast-notification {
    background-color: #333;
    color: white;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

html.dark-mode .toast-notification.error {
    background-color: #d32f2f;
    color: white;
    border-color: #d32f2f;
}