:root {
    /* Light Mode (Default) */
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --accent-color: #3b82f6;
    --card-bg: #ffffff;
    --button-bg: #e2e8f0;
    --button-hover: #cbd5e1;
    --footer-bg: #f1f5f9;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    
    /* Accessibility */
    --min-target-size: 200px;
    --focus-outline: 8px solid #3b82f6;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --accent-color: #60a5fa;
    --card-bg: #1e293b;
    --button-bg: #334155;
    --button-hover: #475569;
    --footer-bg: #020617;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
}

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

body {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 3rem 2rem;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.header-logo {
    height: 100px;
    width: auto;
    border-radius: 1rem;
}

h1 {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--accent-color);
    margin-bottom: 0; /* Removed bottom margin since it's now in a flex container */
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch; /* This ensures both columns have the same height */
    min-height: 500px; /* Base height to ensure visibility */
}

/* Sub-page layout: centered flex column, full width */
.page-main {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
    padding: 3rem 2rem;
}

.image-container {
    width: 100%;
    display: flex;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the height of the container */
    border-radius: 2rem;
    box-shadow: var(--shadow);
}

.languages-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-between;
}

.lang-button {
    flex: 1; /* Each button takes equal share of the total height */
    font-size: 2.2rem;
    font-weight: 700;
    border: none;
    border-radius: 2rem;
    background-color: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.lang-button:hover, .lang-button:focus {
    background-color: var(--button-hover);
    transform: scale(1.05);
    outline: var(--focus-outline);
    outline-offset: 4px;
}

.lang-button:active {
    transform: scale(0.98);
}

footer {
    padding: 2rem;
    background-color: var(--footer-bg);
    display: flex;
    justify-content: center;
    gap: 4rem;
    align-items: center;
}

.footer-logo {
    height: 60px;
    filter: grayscale(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

[data-theme="dark"] .footer-logo {
    filter: grayscale(1) invert(1);
}

.footer-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.1);
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 100;
}



@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}

/* Level Selection Styles */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.level-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    text-align: center;
    height: auto !important;
    min-height: 350px;
}

.level-icon {
    font-size: 5rem;
    display: block;
}

@media (max-width: 900px) {
    .levels-grid {
        grid-template-columns: 1fr;
    }
}

.gender-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Dashboard Styles */
.welcome-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 3rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1000px;
    margin-bottom: 4rem;
    border: 4px solid var(--accent-color);
}

.dashboard-label {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    color: var(--accent-color);
    font-weight: 800;
    margin-bottom: 1rem;
    display: block;
}

/* Dashboard Options */
.dashboard-welcome {
    align-self: flex-end;
    font-size: 1.6rem;
    font-weight: 600;
    opacity: 0.5;
    margin-bottom: 3rem;
    text-align: right;
    width: 100%;
    max-width: 1100px;
}

.dashboard-options-grid {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-option-card {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    border-radius: 2.5rem;
    background-color: var(--button-bg);
    color: var(--text-color);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    min-height: 220px;
    aspect-ratio: 1;
}

.dashboard-option-card:hover,
.dashboard-option-card:focus {
    background-color: var(--button-hover);
    transform: scale(1.02);
    outline: var(--focus-outline);
    outline-offset: 4px;
    box-shadow: 0 20px 40px -8px rgb(0 0 0 / 0.2);
}

.dashboard-option-card:active {
    transform: scale(0.98);
}

.dashboard-option-icon {
    font-size: 6rem;
    display: block;
    line-height: 1;
}

.dashboard-back {
    margin-top: 3rem;
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.45;
    color: var(--text-color);
    background: transparent;
    border: 3px solid var(--button-bg);
    border-radius: 2rem;
    padding: 1rem 4rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.dashboard-back:hover {
    opacity: 0.85;
}


/* Onboarding Forms & Inputs */
.form-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 2.5rem;
    font-size: 3rem;
    border-radius: 2rem;
    border: 6px solid var(--button-bg);
    background: var(--card-bg);
    color: var(--text-color);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: var(--shadow);
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

/* Step Indicator */
.step-indicator {
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--button-bg);
}

.step-dot.active {
    background: var(--accent-color);
    width: 40px;
    border-radius: 20px;
}

/* Profile Page */
.profile-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 900px;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 2.5rem 3.5rem;
    background: var(--card-bg);
    border-radius: 2rem;
    box-shadow: var(--shadow);
    border-left: 8px solid var(--accent-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover {
    transform: translateX(6px);
    box-shadow: 0 12px 30px -8px rgb(0 0 0 / 0.15);
}

.profile-card-icon {
    font-size: 3.5rem;
    flex-shrink: 0;
}

.profile-card-label {
    font-size: 1.4rem;
    font-weight: 600;
    opacity: 0.55;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-card-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--accent-color);
}

/* Favourite Conversations grid – 4 columns × 2 rows */
.conv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}

.conv-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1.8rem 1.2rem;
    background: var(--button-bg);
    border-radius: 2rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    min-height: 200px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.conv-card:hover,
.conv-card:focus {
    background: var(--button-hover);
    transform: scale(1.04);
    outline: var(--focus-outline);
    outline-offset: 4px;
    box-shadow: 0 16px 32px -8px rgb(0 0 0 / 0.18);
}

.conv-card:active {
    transform: scale(0.97);
}

.conv-icon {
    font-size: 5.5rem;
    line-height: 1;
    flex: 1;
    display: flex;
    align-items: center;
}

.conv-label {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    width: 100%;
}

@media (max-width: 900px) {
    .conv-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Profile Choice Screen */
.profile-choice-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-between;
}

.profile-choice-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border-radius: 2rem;
    background-color: var(--button-bg);
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem 1.5rem;
    border: 3px solid transparent;
}

.profile-choice-button:hover,
.profile-choice-button:focus {
    background-color: var(--button-hover);
    transform: scale(1.05);
    outline: var(--focus-outline);
    outline-offset: 4px;
}

.profile-choice-button:active {
    transform: scale(0.98);
}

.new-profile:hover,
.new-profile:focus {
    border-color: var(--accent-color);
}

.existing-profile:hover,
.existing-profile:focus {
    border-color: var(--accent-color);
}

.profile-choice-icon {
    font-size: 4rem;
    line-height: 1;
}

.profile-choice-label {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
}

.profile-choice-sublabel {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.55;
    text-align: center;
}
