/* ===================================
   Reusable Components
   White & Pastel Theme
   =================================== */

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #3d7fc5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--pastel-blue);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--neutral-bg);
}

.card-body {
    padding: 1.75rem;
}

.card-body h3 {
    margin-bottom: 0.75rem;
    color: var(--secondary);
}

.card-body p {
    color: var(--text-mid);
    line-height: 1.75;
}

/* --- Language Switcher --- */
.language-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--pastel-blue);
}

.theme-icon {
    line-height: 1;
    font-size: 0.8rem;
}

.theme-icon-sun {
    display: none;
}

body.theme-dark .theme-icon-moon {
    display: none;
}

body.theme-dark .theme-icon-sun {
    display: inline;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.44rem 0.8rem;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.language-toggle:hover {
    background: var(--pastel-blue);
}

.language-current {
    color: var(--primary);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    padding: 0.35rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1100;
}

.language-switcher.open .language-menu {
    display: block;
}

.lang-option {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-mid);
    text-align: left;
    font-size: 0.82rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: var(--pastel-blue);
    color: var(--text-dark);
}

.lang-option.active {
    background: var(--pastel-blue);
    color: var(--primary);
    font-weight: 400;
}

/* --- Grid Utilities --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* --- Hamburger Menu --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .language-switcher {
        width: 100%;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
    }

    .language-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .language-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}

/* --- Stat / Fact Boxes --- */
.stat-box {
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--pastel-blue);
    border-radius: var(--radius-md);
    min-width: 130px;
}

.stat-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.375rem;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* --- Section Divider --- */
.section-subtitle {
    text-align: center;
    color: var(--text-mid);
    max-width: 560px;
    margin: 0 auto 3rem;
    line-height: 1.75;
    font-size: 1rem;
}

/* --- Scroll Animations --- */
.fade-target {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-target.fade-in {
    opacity: 1;
    transform: translateY(0);
}
