/* Structural layout components: Header, Navigation pills, and Footer. */
/* ─── Header Section ─── */
/* Single merged definition (previously declared twice; the second copy
   silently overrode padding/radius/alignment). Values below are the ones
   that were actually being applied, so the look is unchanged. */
.header {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    background: var(--header-bg);
    padding: 10px 20px;
    border-radius: 10px;
    color: white;
}

/* Top row: logo + title */
.header-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Logo styling */
.logo {
    width: 70px;
    height: auto;
    border-radius: 8px;
}

/* Title */
.header h1 {
    font-size: 2rem;
    line-height: 1.25;
    min-width: 0;
    white-space: normal;
    margin: 0;
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Very narrow devices under 340px */
@media (max-width: 340px) {
    .header h1 {
        font-size: 1.7rem;
    }
}

/* Title mid-flip (offline / back online messages) */
.header h1.is-flipping {
    opacity: 0;
    transform: translateY(-6px);
}

/* Logo + tiny "you are offline" badge on its corner */
.logo-wrap {
    position: relative;
    display: inline-flex;
    flex: none;
}

.offline-badge {
    display: none;
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 22px;
    height: 22px;
    padding: 0;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #f59e0b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.header-top.is-offline .offline-badge {
    display: inline-flex;
    animation: badgePop 0.35s ease;
}

@keyframes badgePop {
    from { transform: scale(0); }
    70%  { transform: scale(1.2); }
    to   { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .header h1 { transition: none; }
    .header-top.is-offline .offline-badge { animation: none; }
}

/* Nav container */
.header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Nav pills */
.header nav a {
    padding: 8px 16px;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s ease;
}

.header nav a:hover {
    background-color: white;
    color: #1565c0;
}

/* Mobile adjustments (stacking / spacing) */
@media (max-width: 720px) {
    .header {
        align-items: flex-start;
        padding: 10px 14px;
    }

    .header-top {
        gap: 12px;
        width: 100%;
    }

    .header nav {
        gap: 10px;
        width: 100%;
        margin-top: 5px;
    }

    .header nav a {
        margin-bottom: 5px; /* extra spacing for mobile */
    }
}

/* ─── Dark Mode Toggle Button ─── */
#darkModeToggle {
    background: var(--toggle-bg);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

#darkModeToggle:hover {
    background: rgba(255,255,255,0.4);
}

/* Rotate the icon based on the active theme state instead of just hover */
html.dark #darkModeToggle {
    transform: rotate(360deg);
}

/* ─── Level pill (All / JCE / MSCE) ─── */
.level-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.level-btn:hover {
    background-color: white;
    color: #1565c0;
}

/* A level is chosen: warm amber, so the state shows without taking any space */
.level-btn.is-active {
    background-color: #ffc107;
    color: #3b2a00;
}

.level-btn.is-active:hover {
    background-color: #ffca2c;
    color: #3b2a00;
}

@media (max-width: 720px) {
    .header nav .level-btn {
        margin-bottom: 5px; /* same spacing as the other nav pills */
    }
}

/* Very narrow phones: drop the arrow so the pill stays on row 2 */
@media (max-width: 370px) {
    .level-btn .level-chev { display: none; }
}

/* ─── Footer Styles ─── */
.footer {
    background-color: #0056b3;
    color: white;
    padding: 40px 20px 20px;
    margin-top: 50px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-logo {
    width: 60px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 8px;
}

.footer-description {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.stats-list {
    list-style: none;
    padding: 0;
}

.stats-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 1.2rem;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s, padding-left 0.2s;
}

.footer-nav a:hover {
    opacity: 1;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-list li {
        justify-content: center;
    }

    .footer-nav {
        align-items: center;
    }
}

/* ─── About / Contact / Request Section ─── */
.about-section, .contact-section {
    padding: 30px;
    max-width: 900px;
    margin: 40px auto;
    background-color: var(--bg-about);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-content {
    margin-top: 40px;
}

.about-flex {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 30px 0;
}

.about-image {
    width: 180px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.about-flex p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.tech-stack {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ─── About Stats Grid ─── */
.about-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 25px 0;
}
.about-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.about-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1.2;
}
.about-stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

/* ─── Milestones Timeline ─── */
.about-timeline {
    margin: 30px 0;
    position: relative;
    padding-left: 24px;
    border-left: 2px solid #cbd5e1;
}
.timeline-item {
    position: relative;
    margin-bottom: 24px;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-bullet {
    position: absolute;
    left: -31px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #2563eb;
}
.timeline-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.timeline-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.timeline-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #475569;
}

/* ─── Quiet Resilience Box ─── */
.resilience-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 25px 0;
}
.resilience-box h4 {
    color: #166534;
    margin-bottom: 6px;
    font-size: 1.05rem;
}
.resilience-box p {
    color: #15803d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ─── Social & Community Links ─── */
.social-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}
.social-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
}
.social-badge-btn:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}
.btn-whatsapp { background: #25D366; color: #ffffff !important; }
.btn-facebook { background: #1877F2; color: #ffffff !important; }
.btn-youtube { background: #FF0000; color: #ffffff !important; }

@media (max-width: 768px) {
    .about-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-image {
        width: 100%;
        max-width: 250px;
    }

    .about-section,
    .contact-section {
        padding: 20px;
        margin: 20px auto;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.reveal {
    transition-delay: var(--tl-delay, 0ms);
}

.developer-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.developer-card h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.4em;
}

.developer-card p {
    color: #666;
    line-height: 1.5;
}

.dev-link {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
    font-weight: bold;
    color: #0077ff;
    padding: 8px 16px;
    border: 2px solid #0077ff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dev-link:hover {
    background: #0077ff;
    color: white;
    text-decoration: none;
}

@media (max-width: 768px) {
    .developer-card {
        width: 100%;
        box-sizing: border-box;
    }
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* ─── About page - Story / Mission / Support boxes ─── */
.about-story-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 20px 22px;
    margin: 25px 0;
}
.about-story-box h3 {
    color: #92400e;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.about-story-box p {
    color: #78350f;
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 10px;
}
.about-story-box p:last-child {
    margin-bottom: 0;
}
.about-story-cost {
    font-style: italic;
    opacity: 0.88;
}

.about-mission-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px 22px;
    margin: 25px 0;
}
.about-mission-box h3 {
    color: #0c4a6e;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.about-mission-box p {
    color: #0369a1;
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 10px;
}
.about-mission-box p:last-child {
    margin-bottom: 0;
}

.about-support-box {
    background: #fdf4ff;
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    padding: 20px 22px;
    margin: 25px 0;
}
.about-support-box h3 {
    color: #581c87;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.about-support-box > p {
    color: #6b21a8;
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 10px;
}
.about-support-list {
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
}
.about-support-list li {
    color: #6b21a8;
    font-size: 0.93rem;
    line-height: 1.6;
    padding: 3px 0;
}
