:root {
    --primary-color: #2c2c2c;
    --secondary-color: #f5f5f5;
    --accent-color: #ff6b35;
    --text-dark: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --background-light: #fafafa;
    --layout-offset: 160px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

/* Header */
header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    position: relative;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand-link { text-decoration: none; color: inherit; display:flex; align-items:center; gap:0.5rem; }

/* Logout link styled like header text (cactus flower) */
.nav-logout {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #bd726c;
    font-weight: 600;
    text-decoration: none;
}
.nav-logout:hover { text-decoration: underline; }

/* Standardized back link (left) and logout (right) pattern */
.nav-back {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #bd726c;
    font-weight: 600;
    text-decoration: none;
}
.nav-back:hover { text-decoration: underline; }

.nav-logout-right {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #bd726c;
    font-weight: 600;
    text-decoration: none;
}
.nav-logout-right:hover { text-decoration: underline; }

/* Right-aligned email aligned to hero image width */
.nav-links {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#user-email {
    color: #bd726c;
    font-weight: 600;
}

.login-button {
    background-color: white;
    color: #bd726c;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}

.login-button:hover {
    background-color: #fff4f2;
    border-color: #e3d3d1;
}

.logo {
    width: 32px;
    height: 32px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Language Selector - Hidden for automatic detection */
.language-selector {
    display: none; /* Hide language selector for automatic detection */
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

#language-select {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.2s ease;
}

#language-select:hover {
    border-color: var(--accent-color);
}

#language-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

/* Hero Section */
.hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0 0.5rem; /* Reduced bottom padding */
}

.hero-background {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* For the button */
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center 20%; 
    border-radius: 20px;
    max-height: 50vh;
}

.hero-content {
    position: absolute;
    top: 55%; /* Nudged down slightly */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.hero-text-below {
    text-align: center;
    padding: 0.5rem 2rem; /* Reduced top and bottom padding */
    margin: 0;
}

.hero-text-below h1 {
    font-size: 1.3rem;
    color: black;
    font-weight: 500;
    margin: 0;
    line-height: 1.6;
}

/* Social Media Icons */
.social-media-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0 0.5rem 0; /* Reduced top and bottom margin */
    padding: 0 2rem;
}

.social-media-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid #e9ecef;
}

.social-media-icons a:hover {
    background-color: #bd726c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(189, 114, 108, 0.3);
}

.social-media-icons svg {
    width: 20px;
    height: 20px;
}

.cta-button {
    background-color: #bd726c;
    color: white;
    border: none;
    padding: clamp(0.6rem, 0.5rem + 0.25vw, 0.75rem) clamp(1.2rem, 1rem + 0.5vw, 1.5rem);
    font-size: clamp(0.9rem, 0.8rem + 0.25vw, 1rem);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(189, 114, 108, 0.3);
}

.cta-button:hover {
    background-color: #a8605b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(189, 114, 108, 0.4);
}

/* Features Section */
.features {
    padding-top: 1rem; /* Reduced top padding */
    padding-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.feature-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.feature-icon img {
    width: 20px;
    height: 20px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.8rem;
    flex-grow: 1;
}

/* Footer */
footer {
    background-color: var(--background-light);
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.25rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.8rem;
}

.footer-links a.footer-feedback-link {
    color: #bd726c;
    font-weight: 600;
}

.footer-links a.footer-feedback-link:hover {
    color: #a8605b;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Dashboard layout */
.dashboard { padding: 20px; }
.dashboard-wrap { max-width: 1200px; margin: 0 auto; }
.dashboard-header h1 { color: #bd726c; margin-bottom: 8px; }
.dashboard-section { margin-top: 28px; }
.dashboard-section h2 { font-size: 1.1rem; color: #333; margin-bottom: 12px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card-item { background: #fff; border: 1px solid var(--border-color); border-radius: 10px; padding: 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.card-item h3 { font-size: 1rem; margin-bottom: 8px; color: #2c2c2c; }
.meta-row { display: flex; align-items: center; gap: 8px; color: #666; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #fff4f2; color: #bd726c; font-size: 12px; border: 1px solid #e3d3d1; }
.muted { color: #666; font-size: 12px; }
.list-loading, .empty-state, .error-state { color: #666; background:#fff; border:1px dashed #eadfdd; padding: 12px; border-radius: 8px; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5vh auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.8;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.modal-actions .modal-accept-button {
    margin: 0; /* override default centering */
    display: inline-flex;
    align-items: center;
}

.modal-actions .secondary-button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* Desert green button variant for Done */
.btn-green {
    background-color: #7ba68c !important; /* desert green */
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(123, 166, 140, 0.3) !important;
}
.btn-green:hover {
    background-color: #69927b !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(123, 166, 140, 0.4) !important;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}


.modal-accept-button {
    display: block;
    margin: 2rem auto 0 auto;
    background-color: #bd726c;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(189, 114, 108, 0.3);
}

.modal-accept-button:hover {
    background-color: #a8605b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(189, 114, 108, 0.4);
}

.modal-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.modal-content ul, .modal-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content li {
    margin-bottom: 0.75rem;
}

.modal-content .rights-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.modal-content .rights-table th, 
.modal-content .rights-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.modal-content .rights-table th {
    background-color: var(--background-light);
}

.modal-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-light);
}


/* Responsive Design */
@media (max-width: 768px) {
    body {
        height: auto;
    }

    main {
        min-height: auto;
    }

    .hero {
        padding: 0;
    }

    .hero-background {
        height: auto; /* Let it scale with image */
        padding: 0 1rem;
    }

    .hero-background img {
        object-position: center 20%; /* Focus a bit higher on mobile */
        max-height: 40vh; /* Give it a max height */
    }
    
    .hero-text-below {
        margin: 0;
        padding: 1.5rem 1rem;
    }

    .hero-text-below h1 {
        font-size: 1.1rem;
    }

    .social-media-icons {
        gap: 1rem;
        margin: 1rem 0;
    }

    .social-media-icons a {
        width: 36px;
        height: 36px;
    }

    .social-media-icons svg {
        width: 18px;
        height: 18px;
    }

    .features {
        padding: 0 0 2rem 0;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 1rem;
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-card h3 {
        font-size: 0.9rem;
    }

    .feature-card p {
        font-size: 0.75rem;
    }

    footer {
        position: static;
        width: 100%;
    }
}

/* RTL Support for Arabic */
body.rtl {
    direction: rtl;
}

body.rtl .navbar {
    flex-direction: row-reverse;
}

body.rtl .nav-brand {
    flex-direction: row-reverse;
}

body.rtl .social-media-icons {
    flex-direction: row-reverse;
}

body.rtl .features-grid {
    direction: rtl;
}

body.rtl .feature-card {
    text-align: right;
}

body.rtl .footer-links {
    flex-direction: row-reverse;
}

body.rtl .modal-content {
    text-align: right;
}

body.rtl .modal-content h2,
body.rtl .modal-content h3 {
    text-align: right;
}

body.rtl .modal-content table {
    direction: rtl;
}

/* Language selector responsive - Hidden but keeping styles for potential future use */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row; /* Keep simple row layout since no language selector */
        gap: 1rem;
        padding: 1rem;
        justify-content: center; /* Center the brand */
    }

    .language-selector {
        display: none; /* Ensure it stays hidden on mobile */
    }

    #language-select {
        min-width: 100px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Beta Signup Form */
.form-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    width: min(680px, 92vw);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.form-card h1 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    color: #bd726c;
    text-align: center;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    row-gap: 1.25rem;
}

.form-grid + .form-grid {
    margin-top: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-group label.required::after {
    content: " *";
    color: #bd726c;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 96px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.form-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

@media (min-width: 640px) {
    .form-grid.two-col {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .form-group.span-2 {
        grid-column: 1 / -1;
    }
}

/* Beta page overrides */
.beta-page .hero-background img {
    display: none;
}

.beta-page .hero-content {
    position: static;
    transform: none;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    width: 100%;
}

.beta-page .form-card {
    width: 100%;
    max-width: 1280px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: white;
}

.beta-page .hero-background {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0; /* align with index hero */
    min-height: calc(100vh - var(--layout-offset));
    border: none;
    border-radius: 20px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.beta-page .features {
    display: none;
}

.beta-page .social-media-icons,
.beta-page .hero-text-below {
    display: none;
}

.secondary-button {
    background-color: white;
    color: var(--text-dark);
    border: 1px solid #eadfdd;
    padding: clamp(0.6rem, 0.5rem + 0.25vw, 0.75rem) clamp(1.2rem, 1rem + 0.5vw, 1.5rem);
    font-size: clamp(0.9rem, 0.8rem + 0.25vw, 1rem);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background-color: #fff4f2;
    border-color: #e3d3d1;
}

/* Content page heading color (cactus flower red) */
.content-page h1,
.content-page h2,
.content-page h3,
.content-page h4 {
    color: #bd726c;
}
