/* ================================
   1. FONTS & VARIABLES
================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Montserrat:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box; /* Ensures padding doesn't increase width */
}

html, body {
    overflow-x: hidden;     /* Forcibly disables horizontal scrolling */
    max-width: 100%;        /* Ensures body never exceeds screen width */
}

:root {
    --blue-soft:     #99B7C6;
    --lavender:      #978EC4;
    --cream:         #F9F5EA;
    --pink-light:    #FFD8D1;
    --pink-mid:      #F9AFB1;
    --green-soft:    #9AB59D;
    --charcoal:      #3A3F3B;
    --coral:         #F4B092;
    --rose-deep:     #CE325B;
    --white:         #FFFFFF;

    --shadow-light:  0 4px 12px rgba(58, 63, 59, 0.08);
    --shadow-mid:    0 8px 24px rgba(58, 63, 59, 0.12);
}

/* ================================
   2. GLOBAL PAGE LAYOUT
================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--cream);
    font-family: 'Montserrat', sans-serif;
    color: var(--charcoal);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    color: var(--charcoal);
    margin-bottom: 0.5em;
}

.content {
    flex: 1;
    padding-top: 80px; /* Space for fixed navbar */
}

/* Footer */
footer {
    background-color: #f4f4f4;
    border-top: 1px solid #ccc;
    padding: 15px 10px 25px; /* extra bottom spacing */
    text-align: center;
    font-size: 0.9rem;
    color: #444;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* spacing between logo and copyright */
}

footer p {
    margin: 0 0 0;
}

footer .brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 2px;
}

footer .brand-logo {
    max-width: 90px;
    width: 100%;
    height: auto;
    display: block;
}

/* ================================
   3. NAVBAR
================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 12px 40px;
    box-sizing: border-box;
    border-bottom: 1px solid #ececec;
}

/* FAILSAFE: This forces ANY image in the navbar to be small */
nav img {
    height: 45px !important; 
    width: auto !important;
    border-radius: 50%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--rose-deep);
    font-family: "DM Serif Display", serif;
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.nav-links a {
    color: var(--charcoal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 10px 0 14px;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover {
    color: var(--rose-deep);
}

.nav-links a.active {
    color: var(--rose-deep);
    border-bottom-color: var(--rose-deep);
    font-weight: 700;
}

/* Flash messages */
.flash-container {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: min(960px, calc(100% - 32px));
    z-index: 2000;
    padding: 0;
    margin: 0;
    pointer-events: none; /* Allow clicks only on flashes */
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-light);
    color: #1f2d3d;
    background: #f5f7fa;
    margin-bottom: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.flash.success {
    border-color: #b8e6c4;
    background: #e9f7ee;
    color: #1f6135;
}

.flash.error {
    border-color: #f2c4c4;
    background: #fdecea;
    color: #8b1e1e;
}

.flash.info {
    border-color: #c7dcf5;
    background: #e8f2ff;
    color: #1f4c8f;
}

.flash.warning {
    border-color: #f4d9b2;
    background: #fff4e2;
    color: #8a5200;
}

.flash-content {
    flex: 1;
    font-weight: 600;
}

.flash-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.flash.fade {
    opacity: 0;
    transform: translateY(-4px);
}
/* ================================
   4. LANDING PAGE & CONTAINERS
================================ */

/* A. Standard Container (For Events, Login, Participants, etc.) 
   This relies on the body's 'cream' background color.
*/
.landing {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    /* No background image here, so it shows the body's cream color */
}

/* B. Home Page Specific Container 
   This applies ONLY to the main landing page with the image.
*/
.landing-home {
    width: 100%;
    margin: 0 auto;
    
    /* Pull background up behind navbar */
    margin-top: -80px;      
    padding: 100px 20px 60px; 
    
    /* Background Image Setup */
    background-image: url('/images/landing-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Parallax effect */
    
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Wrapper to center content inside the full-width home container */
.landing-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}


/* The Main Hero Card */
.landing-hero {
    /* 95% opacity white/pink gradient so text is readable */
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 30%, rgba(255, 216, 209, 0.95) 100%);
    border: 1px solid rgba(255, 216, 209, 0.5);
    border-radius: 24px;
    padding: 40px 50px;
    
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
    
    box-shadow: var(--shadow-mid);
    margin-bottom: 45px;
}

.hero-copy h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin: 0 0 1.25rem;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    background: var(--rose-deep);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* The "What We Focus On" Panel inside the Hero */
.hero-panel {
    background: rgba(255, 255, 255, 0.9); /* 90% opacity white */
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.03);
}

.hero-panel h3 {
    color: var(--rose-deep);
    margin-top: 0;
}

.hero-panel ul {
    padding-left: 20px;
    margin: 0;
}

.events-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
}

/* 3 Pillars Grid */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 45px 0 35px;
}

/* The Individual Cards (Mentor, Volunteer, Donate) */
.card {
    background: rgba(255, 255, 255, 1); /* 95% opacity white */
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s;
}

.card h3 {
    margin-top: 0;
}

.card:hover {
    transform: translateY(-5px);
}

/* Bottom Call to Action Strip */
.cta-strip {
    background: var(--lavender);
    color: var(--white);
    padding: 32px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--shadow-mid);
}

.cta-strip h2 {
    color: var(--white);
    margin: 0;
}

/* ================================
   5. BUTTONS & FORMS
================================ */
.btn, button {
    font-family: 'Montserrat', sans-serif;
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover, button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-rose { background-color: var(--rose-deep); color: var(--white); }
.btn-green { background-color: var(--green-soft); color: var(--white); }
.btn-charcoal { background-color: var(--charcoal); color: var(--white); }
.btn-lavender { background-color: var(--lavender); color: var(--white);}

/* Small Button Variant (for tables) */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    margin: 0 2px; /* Small gap between buttons */
}

/* Soft Button (Pink background, Rose text) */
.btn-soft {
    background-color: var(--pink-light);
    color: var(--rose-deep);
}
.btn-soft:hover {
    background-color: var(--pink-mid);
    color: var(--white);
}

/* Danger Button (Red background) */
.btn-danger {
    background-color: #dc3545;
    color: var(--white);
}
.btn-danger:hover {
    background-color: #bd2130;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

input, select, textarea {
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--pink-light);
    border-radius: 8px;
    background: var(--white);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--lavender);
}

/* ================================
   6. LOGIN PAGE (Two-Column Layout)
================================ */
/* Main container for the split screen */
.login-container-2col {
    display: flex;
    max-width: 900px;
    width: 90%;
    margin: 60px auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-mid);
    overflow: hidden; /* Ensures rounded corners clip content */
    min-height: 500px;
}

/* Left Panel: Decorative/Brand */
.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--pink-mid), var(--rose-deep));
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.login-left h1 {
    color: var(--white);
    font-family: 'DM Serif Display', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.login-left-logo img {
    max-width: 180px;
    height: auto;
    /* Optional: filter to make logo white if needed, otherwise standard */
    filter: brightness(0) invert(1); 
    opacity: 0.9;
}

/* Right Panel: Form */
.login-right {
    flex: 1.2; /* Slightly wider than left panel */
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-right h2 {
    color: var(--charcoal);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.login-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Links below the form */
.login-links-2 {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.login-links-2 a {
    color: var(--lavender);
    text-decoration: none;
    font-weight: 600;
}

.login-links-2 a:hover {
    color: var(--rose-deep);
}

/* Button override for this specific form */
.btn-primary {
    background-color: var(--rose-deep);
    color: var(--white);
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 1.1rem;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .login-container-2col {
        flex-direction: column;
        margin: 20px auto;
        width: 95%;
    }
    
    .login-left {
        padding: 30px;
        min-height: 200px;
    }
    
    .login-right {
        padding: 30px;
    }
}
/* ================================
   8. TABLES (Refined)
================================ */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.styled-table th {
    background: var(--lavender);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
}

.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle; /* Ensures buttons align with text */
}

/* Specific styling for buttons/links inside the table */
.styled-table td button,
.styled-table td a button, 
.styled-table td a {
    /* Reset global button styles for table context */
    display: inline-block;
    width: auto;           /* Prevents full-width stretching */
    margin: 0 4px;         /* Small gap between buttons */
    padding: 6px 14px;     /* Smaller padding for compact rows */
    font-size: 0.85rem;    /* Smaller text */
    line-height: 1.2;
    border-radius: 6px;
    text-decoration: none; /* Removes underline from links */
}

/* Ensure the delete form doesn't break layout */
.styled-table form {
    display: inline-block;
    margin: 0;
}

/* Access level toggle buttons */
.access-level-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.access-level-option {
    position: relative;
}

.access-level-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.access-level-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    padding: 12px;
    border: 2px solid var(--pink-light);
    border-radius: 10px;
    background: #fff;
    font-weight: 600;
    transition: all 0.15s ease;
}

.access-level-option input[type="radio"]:focus + label {
    outline: 2px solid var(--lavender);
    outline-offset: 2px;
}

.access-level-option input[type="radio"]:checked + label {
    background: var(--lavender);
    border-color: var(--lavender);
    color: var(--white);
}

/* Events tabs */
.event-tabs {
    display: inline-flex;
    gap: 8px;
    border: 1px solid var(--pink-light);
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

.event-tab-button {
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    color: var(--charcoal);
    transition: all 0.15s ease;
}

.event-tab-button.active {
    background: var(--lavender);
    color: #fff;
    box-shadow: var(--shadow-light);
}

.event-panel {
    display: none;
}

.event-panel.active {
    display: block;
}
