/* ============================================
   IFC - Main Stylesheet
   ============================================ */

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    color: #2980b9;
}

/* Navigation */
.navbar {
    background: #2c3e50;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #ecf0f1;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

.btn-donate {
    background: #e74c3c;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    color: #fff !important;
    font-weight: bold;
}

.btn-donate:hover {
    background: #c0392b;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-secondary:hover {
    background: #3498db;
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: #3498db;
    color: #fff;
    font-size: 0.9rem;
}

/* ============================================
   Hero Slider
   ============================================ */
.hero {
    position: relative;
    color: #fff;
    padding: 4rem 0;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #1a3a5c; /* fallback if images fail */
}

/* Each slide is a full-cover background layer */
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 0;
    will-change: opacity;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Light gradient overlay for text readability */
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 30, 50, 0.45), rgba(20, 60, 90, 0.35));
    pointer-events: none;
}

/* Content sits above the slides */
.hero .container {
    position: relative;
    z-index: 3;
    width: 100%;
}

.hero h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions .btn-secondary {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.hero-actions .btn-secondary:hover {
    background: #fff;
    color: #2c3e50;
}

/* Slider dots */
.hero-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 4;
}

.hero-dots button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.hero-dots button:hover {
    border-color: #fff;
    transform: scale(1.15);
}

.hero-dots button.active {
    background: #fff;
    border-color: #fff;
}

/* Slider arrows */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.hero-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

.hero-arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Stats */
.stats {
    background: #fff;
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 1rem;
    color: #7f8c8d;
}

/* Featured Children */
.featured-children {
    padding: 3rem 0;
}

.child-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.child-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    padding-bottom: 1rem;
}

.child-card:hover {
    transform: translateY(-5px);
}

.child-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #ecf0f1;
}

.child-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.child-card h3 {
    padding: 0.8rem 1rem 0;
    font-size: 1.1rem;
}

.child-card p {
    padding: 0 1rem;
    font-size: 0.95rem;
    color: #7f8c8d;
}

.child-card .btn-sm {
    margin: 0.5rem 1rem;
    display: inline-block;
}

/* CTA Section */
.cta {
    background: #2c3e50;
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.cta h2 {
    color: #fff;
    font-size: 2.5rem;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta .btn-secondary {
    border-color: #fff;
    color: #fff;
}

.cta .btn-secondary:hover {
    background: #fff;
    color: #2c3e50;
}

/* Footer */
footer {
    background: #1a252f;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

footer h3, footer h4 {
    color: #fff;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: #bdc3c7;
}

footer ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1.5rem;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .hero h1 { font-size: 2rem; }

    .hero {
        min-height: 70vh;
        padding: 3rem 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }

    .hero-arrow {
        width: 40px;
        height: 40px;
    }
    .hero-arrow.prev { left: 10px; }
    .hero-arrow.next { right: 10px; }

    .hero-dots {
        bottom: 16px;
        gap: 10px;
    }
    .hero-dots button {
        width: 10px;
        height: 10px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .child-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
        padding: 2rem 0;
    }
    .hero h1 {
        font-size: 1.7rem;
    }
    /* Hide arrows on very small screens — dots suffice */
    .hero-arrow {
        display: none;
    }
}

.media-source-tabs {
    display: flex; gap: 0.25rem; margin-bottom: 0.75rem;
    border-bottom: 2px solid #ecf0f1;
}
.media-tab {
    background: transparent; border: none; padding: 0.6rem 1rem;
    font-size: 0.9rem; font-weight: 600; color: #7f8c8d;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color 0.2s, border-color 0.2s;
}
.media-tab:hover:not(:disabled) { color: #3498db; }
.media-tab.active { color: #2c3e50; border-bottom-color: #3498db; }
.media-tab:disabled { opacity: 0.4; cursor: not-allowed; }

.media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem; margin-top: 0.5rem;
}
.media-thumb {
    position: relative; display: block; cursor: pointer;
    border: 2px solid #ddd; border-radius: 6px; overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s; background: #fafafa;
}
.media-thumb:hover { border-color: #3498db; }
.media-thumb.selected { border-color: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,0.2); }
.media-thumb input[type="radio"] {
    position: absolute; top: 0.4rem; left: 0.4rem; z-index: 2;
    width: 16px; height: 16px; cursor: pointer;
}
.media-thumb img {
    display: block; width: 100%; height: 120px; object-fit: cover;
}
.media-thumb .media-meta {
    display: block; padding: 0.35rem 0.5rem;
    font-size: 0.72rem; color: #7f8c8d; background: #fff;
    border-top: 1px solid #eee;
}