/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700;900&display=swap');

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

/* Variables */
:root {
    --primary: #1A936F;
    --primary-dark: #126e53;
    --primary-light: #e8f5f1;
    --primary-backdrop: #f4faf8;
    --secondary: #50C878;
    --secondary-accent: #4A9B93;
    --accent: #FF6B6B;
    --dark: #333;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-warm: #8a8480;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Source Sans Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

h5 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Body text improvements */
p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Large text for better hierarchy */
.text-large {
    font-size: 1.125rem;
    line-height: 1.6;
}

.text-small {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Standardized Components */

/* Pills & Badges - Consistent styling */
.pill, .badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Primary badges - filled style for active states */
.badge-primary, .pill-primary {
    background-color: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.badge-primary:hover, .pill-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Secondary badges - outline style for inactive states */
.badge-secondary, .pill-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.badge-secondary:hover, .pill-secondary:hover {
    background-color: var(--primary-light);
}

/* Accent badges */
.badge-accent, .pill-accent {
    background-color: var(--secondary-accent);
    color: white;
    border: 1px solid var(--secondary-accent);
}

/* Status badges */
.badge-success {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #ffc107;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.badge-light {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary-light);
}

/* Size variations */
.badge-sm, .pill-sm {
    padding: 4px 8px;
    font-size: 0.6875rem;
}

.badge-lg, .pill-lg {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hide the placeholder link */
.hidden-link {
    display: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1;
}

.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
}

/* Button variations */
.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-white {
    background: white;
    color: var(--primary);
    border: 1px solid white;
}

.btn-white:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.section {
    padding: 60px 0;
}

.text-center {
    text-align: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
    line-height: 1.2;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Header */
.main-header {
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Non-logged in header styles */
.public-header .container {
    width: 90%;
    max-width: 1200px; 
    margin: 0 auto;
}

.public-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping of items */
}

/* Header right side content */
.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* Public header navigation */
.public-header .main-nav {
    margin-left: auto;
    white-space: nowrap; /* Prevent wrapping */
    flex-shrink: 0; /* Don't allow shrinking */
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav li:first-child {
    margin-left: 0;
}

.main-nav a {
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 5px 0;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--primary);
}

.logo {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex-shrink: 1; /* Allow logo to shrink if needed */
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    height: 35px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

/* Only apply flush left styling to dashboard pages */
.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
}

body.dashboard-page .logo-text {
    margin-left: 0;
    padding-left: 0;
}

.logo-text .role-title {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 2px solid var(--primary);
    color: var(--dark);
    -webkit-text-fill-color: var(--dark);
}

/* User menu and dropdown styling */
.user-menu {
    position: relative;
    z-index: 1500; /* Ensure user menu is above sidebar */
}

.user-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-menu-button:hover,
.user-menu-button:focus {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    padding: 5px 10px 5px 5px;
}

.user-info {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
    margin-right: 5px;
}

.dropdown-indicator {
    color: var(--gray);
    font-size: 0.8rem;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 240px;
    z-index: 1500; /* Increased z-index to be higher than sidebar */
    display: none;
    overflow: hidden;
    animation: fadeIn 0.2s ease-in-out;
}

.user-menu:hover .dropdown-menu,
.user-menu-button:focus + .dropdown-menu {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    padding: 15px 15px;
    border-bottom: 1px solid #f0f0f0;
    background-color: rgba(0, 0, 0, 0.02);
}

.user-full-name {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark);
}

.user-subscription {
    font-size: 0.75rem;
    color: var(--gray);
    background-color: var(--primary-light);
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 600;
}

.user-subscription.active-subscription {
    background-color: var(--primary);
    color: white;
}

.dropdown-divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--dark);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    color: var(--gray);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 30px;
}

.nav-link {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    background-color: var(--light);
    margin-top: 0;
    padding: 0;
}

.hero-content {
    width: 100%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.75rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 24px;
    color: var(--primary-dark);
}

.hero-subtitle {
    font-size: 1.375rem;
    line-height: 1.5;
    margin-bottom: 32px;
    color: var(--gray);
    font-weight: 400;
}

.hero-img {
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* About Section */
.about {
    background-color: white;
}

.about-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.about-content {
    width: 48%;
}

.about-img {
    width: 48%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.about-img img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.about-img:hover img {
    transform: scale(1.05);
}

/* Features Section */
.features {
    background-color: var(--primary-backdrop);
}

.features-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 60px;
}

.feature-card {
    width: 30%;
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon i {
    color: white;
    font-size: 1.5rem;
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

/* Team Section */
.team-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 60px;
}

.team-member {
    width: 23%;
    margin-bottom: 40px;
    text-align: center;
}

.team-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.team-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.team-role {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 15px;
}

/* Contact Section */
.contact {
    background: var(--primary);
    color: white;
}

.contact .section-title::after {
    background: white;
}

.contact-form {
    width: 60%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--primary-light);
    font-size: 1rem;
}

textarea.form-control {
    height: 150px;
    resize: none;
}

.btn-white {
    background: white;
    color: var(--primary);
}

.btn-white:hover {
    background: #f0f0f0;
    color: var(--primary-dark);
}

/* Footer */
.main-footer {
    background-color: #154734;
    color: white;
    padding: 60px 0 30px;
    clear: both;
    position: relative;
    z-index: 100;
}

.footer-container,
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 60%;
}

.footer-column {
    width: 30%;
    margin-bottom: 20px;
}

.footer-about-only {
    width: 100%;
    text-align: center;
}

.footer-about-only ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-about-only li {
    margin-bottom: 0;
}

.footer-logo {
    width: 30%;
}

.footer-col {
    width: 23%;
}

.footer-title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    line-height: 1.3;
    color: #ffffff !important; /* White text for WCAG compliance */
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-link {
    margin-bottom: 15px;
}

.footer-link a {
    color: #ffffff; /* White text for WCAG AAA compliance (8.9:1 contrast ratio) */
    transition: color 0.3s ease;
    font-weight: 600; /* Makes text slightly bolder */
}

.footer-link a:hover {
    color: #50C878; /* Light green on hover (still meets WCAG AA at 4.7:1) */
    text-decoration: underline;
}

.footer-social {
    display: flex;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: background 0.3s ease;
}

.social-icon:hover {
    background: var(--accent);
}

.social-icon i {
    color: white;
    font-size: 1.2rem;
}

.footer-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    color: #ffffff; /* White text for WCAG compliance on dark green background */
    text-align: center; /* Centered text */
    width: 100%; /* Ensure full width */
    padding: 15px 0; /* Add some padding */
}

.copyright p {
    color: #ffffff !important;
    margin: 0;
}

.footer-legal {
    color: #ffffff !important;
}

.footer-legal a {
    color: #ffffff !important;
    text-decoration: none;
    margin: 0 15px;
}

.footer-legal a:hover {
    color: #50C878 !important;
    text-decoration: underline;
}

/* Ensure all footer text is white */
.main-footer, .main-footer p, .main-footer li, .main-footer span {
    color: #ffffff !important;
}

/* Ensure footer links are white */
.main-footer a, .main-footer .footer-link a {
    color: #ffffff !important;
}

.main-footer a:hover, .main-footer .footer-link a:hover {
    color: #50C878 !important;
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 15px;
}

/* Dropdown Menu Styles - added for mobile sidebar navigation */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    padding: 15px 0;
    z-index: 1000;
    display: none;
}

.dropdown-header {
    padding: 8px 20px;
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    color: var(--dark);
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--secondary-accent);
}

.dropdown-item i {
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--gray);
}

.dropdown-item:hover i {
    color: var(--secondary-accent);
}

.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Mobile navigation menu styles */
.mobile-nav-menu {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin: 8px 0;
    padding: 8px 0;
    max-height: 40vh;
    overflow-y: auto;
}

/* Enhanced dropdown menu for mobile */
@media (max-width: 992px) {
    .dropdown-menu {
        max-height: 80vh;
        overflow-y: auto;
        width: 280px; /* Wider on mobile */
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .logo-text .role-title {
        display: none;
    }
    
    .hero-content, .hero-img {
        width: 100%;
        text-align: center;
    }

    .hero-img {
        margin-top: 50px;
        order: 2;
    }

    .about-content, .about-img {
        width: 100%;
    }

    .about-img {
        margin-top: 50px;
        order: 1;
    }

    .about-content {
        order: 2;
    }

    .feature-card {
        width: 48%;
    }

    .team-member {
        width: 48%;
    }

    .contact-form {
        width: 80%;
    }

    .footer-col,
    .footer-column,
    .footer-logo,
    .footer-links {
        width: 48%;
        margin-bottom: 40px;
    }
}

/* Responsive Typography */
@media (max-width: 992px) {
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 0 0 30px 0;
    }

    .feature-card, .team-member, .footer-col, .footer-column, .footer-logo, .footer-links {
        width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }

    .contact-form {
        width: 100%;
    }
}
