/* In static/css/style.css (REPLACE THE ENTIRE FILE WITH THIS) */

/* --- 1. Font Import & Color Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --theme-green: #2a9d8f;
    --theme-dark-blue: #264653;
    --theme-accent: #e76f51;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --text-dark: #343a40;
    --text-light: #6c757d;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- 2. Global Resets & Body --- */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px; /* Add padding to the sides */
}

/* --- 3. Navigation Bar (from layout.html) --- */
nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 30px;
}
nav .nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav .logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--theme-green);
    text-decoration: none;
}
nav .nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.2s ease;
}
nav .nav-links a:hover {
    color: var(--theme-green);
}

/* --- 4. Buttons & Forms --- */
.btn {
    background: var(--theme-green);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: background 0.2s ease;
}
.btn:hover {
    background: #248a7f;
}
.btn-accent {
    background: var(--theme-accent);
}
.btn-accent:hover {
    background: #e06041;
}

/* Standardized Form Styling */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box; /* Fixes padding issues */
}
.form-check {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- 5. Alerts & Cards --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* The new "Rounded Card" base style */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Your "rounded" spec */
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden; /* For images */
}
.card-body {
    padding: 25px;
}
.card-header {
    padding: 20px 25px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}
.card-header h1, .card-header h2, .card-header h3 {
    margin: 0;
}
.card-footer {
    padding: 20px 25px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* --- 6. Page-Specific: Landing Page --- */
.hero {
    background: #eaf7f6; /* A light, hopeful green */
    padding: 80px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 30px;
}
.hero h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--theme-dark-blue);
}
.hero p {
    font-size: 1.25em;
    color: var(--theme-green);
    margin-bottom: 30px;
}
.hero .btn-accent {
    font-size: 1.1em;
    padding: 15px 30px;
}
.impact-counter {
    text-align: center;
    margin: 40px 0;
    font-size: 1.5em;
    color: var(--theme-dark-blue);
}
.featured-projects h2 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 30px;
    color: var(--theme-dark-blue);
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* --- 7. Page-Specific: Browse Page --- */
.browse-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}
.browse-header h1 { font-size: 2.5em; color: var(--theme-dark-blue); margin: 0; }
.browse-header p { font-size: 1.2em; color: var(--theme-green); }

.filter-panel {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.filter-panel .tabs button {
    background: #f0f8f7;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    color: var(--theme-green);
    transition: all 0.2s ease;
}
.filter-panel .tabs button.active,
.filter-panel .tabs button:hover {
    background: var(--theme-green);
    color: #fff;
    border-color: var(--theme-green);
}
.filter-panel .sort-by select { min-width: 200px; }

.project-card-image {
    height: 180px;
    background: var(--theme-dark-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 600;
}
.project-card-metrics {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    font-size: 0.9em;
}
.project-card-metrics li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.project-card-metrics li:last-child { border-bottom: none; }
.project-card-metrics strong { color: var(--theme-dark-blue); }
.progress-bar { width: 100%; }

/* --- 8. Page-Specific: Project Detail Page --- */
.project-header {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
}
.project-header h1 { font-size: 2.5em; color: var(--theme-dark-blue); margin: 0; }
.project-header .category-tag {
    display: inline-block;
    background: var(--theme-green);
    color: #fff;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.9em;
}
.project-grid-detail {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}
.quick-facts {
    list-style: none;
    padding: 0;
}
.quick-facts li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95em;
}
.quick-facts strong { color: var(--text-dark); }

.impact-callout {
    background: #eaf7f6;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    margin-top: 20px;
}
.impact-callout p {
    font-size: 1.1em;
    color: var(--theme-green);
    margin: 0;
}
.impact-callout strong { color: var(--theme-dark-blue); }


/* --- 9. Page-Specific: Dashboard --- */
.dash-header {
    background: var(--theme-dark-blue);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
}
.dash-header h1 { margin: 0; font-size: 2.2em; }
.dash-header p { font-size: 1.2em; opacity: 0.9; margin: 5px 0 0 0; }

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.stat-card {
    /* Use the global .card style! */
    padding: 25px;
}
.stat-card .label {
    font-size: 0.9em;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: bold;
}
.stat-card .value {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--theme-green);
    margin-top: 5px;
}
.stat-card .value.positive { color: var(--theme-green); }
.stat-card .value.negative { color: var(--theme-accent); }
.stat-card .value.neutral { color: var(--theme-dark-blue); }

.dash-tabs {
    margin-top: 30px;
}
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}
.tab-nav button {
    padding: 15px 25px;
    border: none;
    background: none;
    font-size: 1.1em;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px; /* Aligns with the border */
}
.tab-nav button.active, .tab-nav button:hover {
    color: var(--theme-green);
    border-bottom-color: var(--theme-green);
}
.tab-content {
    display: none; /* Hidden by default */
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.tab-content.active {
    display: block; /* Shown by JS */
}

.portfolio-list .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.portfolio-list .item:last-child { border-bottom: none; }
.portfolio-list .item-name { font-size: 1.2em; font-weight: 600; color: var(--theme-dark-blue); }
.portfolio-list .item-impact { font-size: 0.9em; color: var(--text-light); }
.portfolio-list .item-values { text-align: right; }
.portfolio-list .item-values .current { font-size: 1.1em; font-weight: bold; color: var(--theme-green); }
.portfolio-list .item-values .invested { font-size: 0.9em; color: var(--text-light); }

.badge-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
}
.badge {
    background: #f0f8f7;
    border: 1px solid var(--theme-green);
    color: var(--theme-dark-blue);
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: 600;
    text-align: center;
}
.badge.locked {
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
}
