/* General Styles */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #222222;
    --header-bg: #333333;
    --header-text: #ffffff;
    --accent-color: #ff4081;
    --section-bg: #f9f9f9;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;

    /* Pink color palette */
    --pink-magenta: #E20074;
    --pink-dark-magenta: #990F5E;
    --pink-light-magenta: #FF38A8;
    --pink-black: #000000;
    --pink-dark-gray: #333333;
    --pink-gray: #767676;
    --pink-light-gray: #F2F2F2;
    --pink-white: #FFFFFF;
    
    /* Light mode */
    --primary-color: var(--pink-magenta);
    --secondary-color: var(--pink-dark-magenta);
    --accent-color: var(--pink-light-magenta);
    --accent-color-hover: var(--pink-magenta);
    --background-color: var(--pink-white);
    --text-color: var(--pink-black);
    --header-bg: var(--pink-white);
    --header-text: var(--pink-black);
    --section-bg: var(--pink-light-gray);
    --button-hover: var(--pink-dark-magenta);
    --card-bg: var(--pink-white);
    --card-border: var(--pink-gray);
    --link-color: var(--pink-dark-magenta);
    --active-nav-bg: #f0f0f0;
    --active-nav-border: var(--pink-magenta);
}

/* Prevent flash of unstyled content during theme load */
.preload * {
    transition: none !important;
}

/* Dark theme variables */
html[data-theme='dark'], .dark-mode {
    --bg-color: #121212;
    --text-color: #f0f0f0;
    --heading-color: #ffffff;
    --header-bg: #1f1f1f;
    --header-text: #ffffff;
    --accent-color: #ff79b0;
    --accent-color-hover: #E20074;
    --section-bg: #1a1a1a;
    --card-bg: #2a2a2a;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --active-nav-bg: #333333;
    --active-nav-border: #ff79b0;
    
    --primary-color: #FF5CAF;
    --secondary-color: var(--pink-magenta);
    --button-color: #E20074;
    --background-color: #121212;
    --button-hover: #990F5E;
    --card-border: #555555;
    --link-color: #FF8DC1;
}

/* System preference detection - as fallback */
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --heading-color: #f0f0f0;
        --header-bg: #1f1f1f;
        --header-text: #ffffff;
        --accent-color: #ff79b0;
        --accent-color-hover: #E20074;
        --section-bg: #1a1a1a;
        --card-bg: #2a2a2a;
        --card-shadow: rgba(0, 0, 0, 0.3);
        --active-nav-bg: #333333;
        --active-nav-border: #ff79b0;
        --button-color: #E20074;
        --button-hover: #990F5E;
    }
}

html, body {
    transition: background-color var(--transition-speed), 
                color var(--transition-speed),
                border-color var(--transition-speed);
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Ensure header and navigation consistency across all pages */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    background-color: var(--header-bg);
    color: var(--header-text);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    height: 60px;
}

.site-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--header-text);
    margin-right: auto;
    display: flex;
    align-items: center;
    height: 100%;
    transition: color var(--transition-speed);
}

/* Fix navigation styling */
.main-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.main-nav ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.main-nav ul li {
    display: flex;
    align-items: center;
    margin: 0 10px;
    height: 100%;
}

.main-nav ul li a {
    display: flex;
    align-items: center;
    color: var(--header-text);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
    padding: 0.5rem 0.8rem;
    position: relative;
}

.main-nav ul li a:hover {
    color: var(--primary-color);
}

.main-nav ul li a.active {
    color: var(--primary-color);
    position: relative;
}

.main-nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Ensure theme toggle is consistent */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--header-text);
    transition: transform 0.3s;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

/* Mobile menu button for hamburger (hide it by default) */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--header-text);
    padding: 0;
    margin-right: 15px;
    transition: transform 0.3s;
    z-index: 200; /* Ensure button stays on top */
}

.mobile-menu-button:hover {
    transform: scale(1.1);
}

.mobile-menu-button:focus {
    outline: none;
}

/* Hamburger icon */
.hamburger-icon {
    display: block;
    position: relative;
    width: 24px;
    height: 24px;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--header-text);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
    top: 0px;
}

.hamburger-icon span:nth-child(2) {
    top: 10px;
}

.hamburger-icon span:nth-child(3) {
    top: 20px;
}

/* Animation for hamburger to X */
.mobile-menu-open .hamburger-icon span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.mobile-menu-open .hamburger-icon span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.mobile-menu-open .hamburger-icon span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    padding: 2rem;
    margin: 1rem 0;
    background-color: var(--section-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    animation: fadeIn 0.8s ease-in-out;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
}

h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    margin: 0.5rem 0;
}

ul {
    padding-left: 1.5rem;
}

ul li {
    margin-bottom: 0.8rem;
}

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

a.cta-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--button-color, var(--primary-color)); /* Use button-color if defined, otherwise fallback to primary-color */
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

a.cta-button:hover {
    background-color: var(--button-hover);
    transform: translateY(-3px);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.team-member {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    padding: 1.5rem;
    border: 1px solid var(--card-border);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

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

.team-member-info {
    padding: 1.5rem;
}

.team-member-info h3 {
    margin-top: 0;
    color: var(--heading-color);
}

/* Enhance role styling */
.role {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}

.team-member-info .role {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Increase LinkedIn icon size */
.linkedin-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
}

.linkedin-link:hover {
    text-decoration: underline;
}

.linkedin-icon {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
    transition: transform 0.3s ease, fill 0.3s ease;
}

.linkedin-icon:hover {
    transform: scale(1.15);
    fill: var(--pink-dark-magenta);
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--header-bg);
    margin-top: 3rem;
    color: var(--header-text);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Feature list styling with improved contrast */
#features ul {
    list-style: none;
    padding: 0;
}

#features li {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--accent-color);
    background-color: var(--card-bg);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 4px var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

#features li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px var(--card-shadow);
}

/* Hero section enhancements */
#about h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

#about p {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Purpose page styles */
.purpose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.purpose-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 15px;
}

.purpose-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--card-shadow);
}

.purpose-card:hover .team-photo {
    transform: scale(1.05);
}

.purpose-card h3 {
    color: var(--accent-color);
    margin-top: 5px;
    margin-bottom: 0.8rem;
}

.purpose-card p:last-of-type {
    margin-bottom: 15px;
}

/* Ensure proper spacing in the purpose card for the new element */
.purpose-card .linkedin-link {
    margin-top: auto;
    padding-top: 12px;
}

/* LinkedIn SVG icon styling */
.social-link {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.linkedin-icon {
    width: 32px;
    height: 32px;
    fill: var(--primary-color);
    transition: transform 0.3s ease, fill 0.3s ease;
}

.linkedin-icon:hover {
    transform: scale(1.15);
    fill: var(--pink-dark-magenta);
}

/* Team photo styling */
.team-photo-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 15px;
    background-color: var(--pink-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Create placeholder style */
.team-photo[src*="placeholder"] {
    opacity: 0.7;
    object-fit: contain;
    padding: 20px;
}

/* Preview Image Styles */
.preview-container {
    margin: 30px 0;
}

.preview-container.left-align {
    text-align: left;
}

.preview-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* For medium and larger screens, limit image width */
@media (min-width: 768px) {
    .preview-image {
        max-width: 60%;
    }
}

/* Dive deeper page styles */
.feature-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    border-top: 4px solid var(--accent-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--card-shadow);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--heading-color);
}

#dive-deeper ul {
    list-style-type: square;
    margin-left: 1.5rem;
    margin-bottom: 2rem;
}

#dive-deeper li {
    margin-bottom: 0.5rem;
}

/* Add the GPT instructions collapsible section styles */
.gpt-instructions {
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px var(--card-shadow);
}

.gpt-instructions summary {
    font-weight: bold;
    cursor: pointer;
    padding: 1rem;
    border-radius: 4px;
    background-color: var(--button-color, var(--primary-color)); /* Use button-color if defined */
    color: white;
    transition: background-color 0.3s;
}

.gpt-instructions summary:hover {
    background-color: var(--button-hover);
}

.gpt-instructions-content {
    padding: 1rem;
}

.gpt-instructions-content h2 {
    margin-top: 1rem;
}

.gpt-instructions-content ul {
    list-style-type: disc;
    margin-left: 2rem;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        height: 60px;
        padding: 0 20px;
        position: relative;
    }
    
    .site-title {
        margin: 0;
        justify-content: center;
        text-align: center;
        flex-grow: 1;
    }
    
    .mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
        order: -1; /* Place button at the beginning */
    }
    
    .theme-toggle {
        order: 2; /* Place toggle at the end */
        margin-left: 15px;
        position: relative;
    }
    
    .main-nav {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: 0;
        overflow: hidden;
        background-color: var(--header-bg);
        transition: height 0.3s ease;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        z-index: 100;
    }
    
    .main-nav.mobile-open {
        height: auto;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }
    
    .main-nav ul li {
        width: 100%;
        margin: 0;
        height: auto;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .main-nav ul li:last-child {
        border-bottom: none;
    }
    
    .main-nav ul li a {
        padding: 15px 20px;
        width: 100%;
        justify-content: center;
        font-size: 1rem;
    }
    
    .main-nav ul li a.active::after {
        bottom: 0;
        height: 3px;
        width: 40%;
        left: 30%;
    }
    
    /* Remove mobile-menu-toggle styles since we're using mobile-menu-button */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Reset duplicate styles */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
}

/* Adjust the additional mobile optimization for very small screens */
@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .main-nav ul li a {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* Remove or update this section since we need to change the mobile menu logic */
@media (max-width: 360px) {
    .header-container {
        padding: 0 10px;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
    
    .theme-toggle {
        padding: 0.3rem;
        font-size: 1.3rem;
    }
    
    /* Remove existing mobile toggle since we're replacing it */
    .mobile-menu-toggle {
        display: none !important;
    }
}