 /********** Template CSS **********/
:root {
    /* Primary green taken from logo (tuned to a rich, vibrant green) */
    --primary: #009245;
    --secondary: #E8F5E9;
    --light: #F8F8F9;
    --dark: #001D23;
    --accent-gold: #f4c542;
    --bs-primary: #009245;
}

/* Global typography */
body {
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.section-heading .section-title {
    font-family: "Saira", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

/* Override Bootstrap primary colors */
.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Override other Bootstrap primary color usages */
.progress-bar {
    background-color: var(--primary) !important;
}

.badge-primary,
.badge.bg-primary {
    background-color: var(--primary) !important;
}

.alert-primary {
    background-color: rgba(0, 146, 69, 0.1) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.list-group-item-primary {
    background-color: rgba(0, 146, 69, 0.1) !important;
    color: var(--primary) !important;
}

.table-primary,
.table-primary > th,
.table-primary > td {
    background-color: rgba(27, 94, 32, 0.1) !important;
}

.spinner-grow.text-primary,
.spinner-border.text-primary {
    color: var(--primary) !important;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/* Chatbot widget */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.chatbot-window {
    width: 320px;
    max-height: 420px;
    background: #001D23;
    border-radius: 16px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.chatbot-window.show {
    display: flex;
    animation: chatbot-pop 0.4s ease-out;
}

.chatbot-header {
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: #fff;
}

.chatbot-body {
    padding: 0.75rem 0.75rem 0.25rem;
    background: #001D23;
    color: #fff;
    overflow-y: auto;
    max-height: 260px;
}

.chatbot-form {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #00151a;
    gap: 0.5rem;
}

.chatbot-input {
    flex: 1;
    background: #001D23;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chatbot-send {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chatbot-message {
    display: flex;
    margin-bottom: 0.5rem;
}

.chatbot-message-bot {
    justify-content: flex-start;
}

.chatbot-message-user {
    justify-content: flex-end;
}

.chatbot-bubble {
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
}

.chatbot-message-bot .chatbot-bubble {
    background: rgba(0, 146, 69, 0.2);
    border: 1px solid rgba(0, 146, 69, 0.6);
}

.chatbot-message-user .chatbot-bubble {
    background: #ffffff;
    color: #001D23;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    padding: 2px;
}

@keyframes chatbot-pop {
    0% {
        transform: translateY(10px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
    background: radial-gradient(circle at top, rgba(0, 146, 69, 0.25), transparent 55%),
                #001D23;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.spinner-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner-logo-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}

.spinner-clock-hand {
    position: absolute;
    width: 2px;
    height: 40%;
    background: #ffffff;
    top: 10%;
    left: 50%;
    transform-origin: bottom center;
    animation: spinner-clock-rotate 5s linear infinite;
}

.spinner-clock-center-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spinner-clock-rotate {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

.spinner-inner .spinner-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    transform-origin: center;
    animation: spinner-logo-pulse 1.2s ease-in-out infinite;
}

@keyframes spinner-logo-pulse {
    0% {
        transform: scale(0.75);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(0.75);
    }
}


/*** Button ***/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-outline-primary:hover {
    color: #FFFFFF;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn.btn-primary:hover {
    color: var(--primary);
    background: transparent;
    border-color: var(--primary) !important;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}


/*** Navbar ***/
.fixed-top {
    transition: .5s;
}

.top-bar {
    height: 45px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.top-bar small {
    font-size: 0.9rem;
    font-weight: 500;
    color: #FFFFFF;
}

.top-bar i {
    color: #FFFFFF;
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar .navbar-nav .nav-link {
    margin-right: 30px;
    padding: 1rem 0;
    color: #FFFFFF;
    font-weight: 500;
    font-size: 0.95rem;
    outline: none;
    white-space: nowrap;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        margin-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, .07);
        background: var(--dark);
    }

    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: .5s;
        opacity: 0;
    }

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(0, 29, 35, .8);
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
    width: 15%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--dark);
    border: 12px solid var(--dark);
    border-radius: 3rem;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    padding-top: 12rem;
    padding-bottom: 6rem;
    background: linear-gradient(rgba(0, 29, 35, .8), rgba(0, 29, 35, .8)), url(../img/carousel-1.jpg) center center no-repeat;
    background-size: cover;
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: #999999;
}


/*** Section headings (About, Key Objectives, Thematic Focus, Expected Outcomes) ***/
.section-heading {
    margin-bottom: 2rem;
}

.section-heading .section-label {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dark);
    background: rgba(244, 197, 66, 0.18);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.section-heading .section-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.section-heading .section-tagline {
    font-size: 1.05rem;
    color: #6c757d;
    margin-bottom: 0;
    max-width: 560px;
    line-height: 1.5;
}

.section-heading.section-heading-left .section-tagline {
    max-width: 100%;
}

.section-heading:not(.section-heading-left) .section-tagline {
    margin-left: auto;
    margin-right: auto;
}


/*** Causes ***/
.causes-item .progress {
    height: 5px;
    border-radius: 0;
    overflow: visible;
}

.causes-item .progress .progress-bar {
    position: relative;
    overflow: visible;
    width: 0px;
    border-radius: 0;
    transition: 5s;
}

.causes-item .progress .progress-bar span {
    position: absolute;
    top: -7px;
    right: 0;
    width: 40px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: var(--primary);
    color: #FFFFFF;
}

.causes-item .causes-overlay {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    overflow: hidden;
    opacity: 0;
    transition: .5s;
}

.causes-item:hover .causes-overlay {
    height: 100%;
    opacity: 1;
}

/* Ensure all images in Key Areas section have same size */
#themes .causes-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}


/*** Service ***/
.service-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .06);
}


/*** Donate ***/
.donate {
    background: rgba(0, 29, 35, .8);
}

/* Improve readability in "Get Involved with TAYRuCO" section */
.donate .text-white-50 {
    color: rgba(255, 255, 255, 0.88) !important;
}

.donate h1,
.donate p,
.donate .fa {
    color: #ffffff;
}

.btn-group .btn-light:hover,
.btn-group input[type="radio"]:checked+label {
    color: var(--primary);
    border-color: var(--primary);
}

/*** Registration Form ***/
.registration-form {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(0, 146, 69, 0.25);
    background: radial-gradient(circle at top left, rgba(0, 146, 69, 0.18), transparent 55%),
                radial-gradient(circle at bottom right, rgba(0, 146, 69, 0.12), transparent 55%),
                #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: all 0.35s ease;
}

.registration-form:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 146, 69, 0.55);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5) !important;
}

.form-control-custom,
.form-select.form-control-custom {
    background: linear-gradient(135deg, #F8FFF9, #F1F8F5);
    border: 2px solid #E0EFE6;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control-custom:focus,
.form-select.form-control-custom:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(27, 94, 32, 0.15);
    outline: none;
}

.form-control-custom:hover,
.form-select.form-control-custom:hover {
    border-color: rgba(0, 146, 69, 0.4);
}

.form-floating > label {
    color: #6c757d;
    padding-left: 0.75rem;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-select:focus ~ label {
    color: var(--primary);
}

.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select:not([value=""]) ~ label {
    color: var(--primary);
}

.floating-select {
    position: relative;
}

.floating-select .form-control-custom,
.floating-select .form-select.form-control-custom {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.floating-select > label {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
}

.floating-select.is-focused > label,
.floating-select.has-value > label {
    top: 0.6rem;
    transform: scale(0.85);
    transform-origin: left top;
    color: var(--primary);
}

.floating-select select {
    appearance: none;
}

.btn-register {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 1.05rem;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 146, 69, 0.2);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 146, 69, 0.3);
}

.btn-register:active {
    transform: translateY(0);
}

/* Override any orange colors in form elements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 146, 69, 0.15) !important;
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px;
}

/* Ensure no orange appears in any form validation states */
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--primary) !important;
}

.was-validated .form-control:valid:focus,
.was-validated .form-select:valid:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 146, 69, 0.15) !important;
}

/* Make the logo pop on dark backgrounds */
.navbar-brand img {
    display: block;
    max-height: 120px;
    height: auto;
    border-radius: 50%;
    background: #FFFFFF;
    padding: 4px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

.footer img[alt*="TAYRuCO"] {
    display: block;
    max-width: 180px;
    height: auto;
    border-radius: 50%;
    background: #FFFFFF;
    padding: 4px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}


/*** Team ***/
.team-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: center;
    transition: .5s;
    border-radius: 16px;
    border: 4px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 146, 69, 0.3), 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Custom crop for first and third team members (Clement & Bunjo) */
#team img[src*="team-1.jpg"],
#team img[src*="team-3.jpg"] {
    height: 280px;
    object-position: top center;
}

.team-item .team-text {
    position: relative;
    padding-top: 1rem;
    padding-bottom: 1.25rem;
    height: auto;
}

.team-item .team-text .team-social {
    opacity: 1;
}

.team-meta {
    font-size: 0.8rem;
}

.team-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gold);
    display: inline-block;
}

.team-item .team-social .btn {
    display: inline-flex;
    color: var(--primary);
    background: #FFFFFF;
    border-radius: 40px;
}

.team-item .team-social .btn:hover {
    color: #FFFFFF;
    background: var(--primary);
}


/*** Testimonial ***/
.testimonial-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.testimonial-carousel::after {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

@media (min-width: 768px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 200px;
    }
}

@media (min-width: 992px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 300px;
    }
}

.testimonial-carousel .owl-item .testimonial-text {
    background: var(--light);
    transform: scale(.8);
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text {
    background: var(--primary);
    transform: scale(1);
}

.testimonial-carousel .owl-item .testimonial-text *,
.testimonial-carousel .owl-item .testimonial-item img {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text * {
    color: var(--light) !important;
}

.testimonial-carousel .owl-item.center .testimonial-item img {
    background: var(--primary) !important;
} 

.testimonial-carousel .owl-nav {
    position: absolute;
    width: 350px;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: .5s;
    z-index: 1;
}

.testimonial-carousel:hover .owl-nav {
    width: 300px;
    opacity: 1;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    position: relative;
    color: var(--primary);
    font-size: 45px;
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    color: var(--dark);
}


/*** Footer ***/

.footer {
    color: rgba(255, 255, 255, 0.9);
}

.footer .text-white-50 {
    color: rgba(255, 255, 255, 0.9) !important;
}

.footer #contact p,
.footer #contact i {
    color: rgba(255, 255, 255, 0.92) !important;
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: rgba(255,255,255,0.9);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: rgba(255,255,255,0.7);
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--light);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .btn.btn-square {
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.7);
}

.footer .btn.btn-square:hover {
    color: var(--secondary);
    border-color: var(--light);
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(256, 256, 256, .1);
    color: rgba(255,255,255,0.85);
}

.footer .copyright a {
    color: var(--secondary);
}

.footer .copyright a:hover {
    color: var(--primary);
}

/*** Country Flags in Footer ***/
.country-flags .flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
    cursor: default;
    min-width: 70px;
}

.country-flags .flag-item:hover {
    transform: translateY(-3px);
}

.country-flags .flag-icon {
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    border-radius: 4px;
}

.country-flags .flag-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    white-space: nowrap;
}

.country-flags .host-country .flag-item {
    min-width: auto;
}

.country-flags .host-country .flag-emoji {
    font-size: 3rem;
}

.country-flags .host-country .flag-name {
    font-size: 1rem;
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .country-flags .flag-item {
        min-width: 60px;
    }
    
    .country-flags .flag-icon {
        font-size: 2rem !important;
    }
    
    .country-flags .flag-name {
        font-size: 0.75rem;
    }
}