/* Bloomstead Development Foundation - Custom Styles */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --white: #ffffff;
    --dark: #212529;
    --light-gray: #f8f9fa;
    --text-muted: #6c757d;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark);
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Main Navigation - Custom Implementation (Replaces Bootstrap Navbar) */
.main-navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.navbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 70px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

.desktop-nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.desktop-nav-item {
    list-style: none;
    margin: 0;
}

.desktop-nav-link {
    font-weight: 500;
    color: var(--dark);
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: block;
    border-radius: 5px;
}

.desktop-nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

.desktop-nav-donate {
    background-color: var(--primary-color);
    color: #fff !important;
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    margin-left: 0.5rem;
}

.desktop-nav-donate:hover {
    background-color: var(--primary-dark) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Show desktop nav on large screens */
@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
        flex: 1;
        justify-content: flex-end;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Hide desktop nav and show mobile toggle on small screens */
@media (max-width: 991.98px) {
    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.min-vh-50 {
    min-height: 50vh;
}

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 3rem 0;
}

/* Cards */
.card {
    border-radius: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* Icon Boxes */
.icon-box {
    background-color: rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
}

.icon-box:hover {
    background-color: var(--primary-color);
    color: var(--white) !important;
}

.icon-box:hover i {
    color: var(--white) !important;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Impact Numbers / Stats */
.stat-box {
    padding: 1.5rem;
}

.stat-box h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Program Items */
.program-item {
    padding: 2rem 0;
}

.program-item img {
    border-radius: 10px;
}

/* Project Cards */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

/* Footer */
.footer {
    background-color: var(--dark) !important;
    padding-top: 3rem;
}

.footer-logo {
    height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.footer h5 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.footer a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer .social-links a {
    display: inline-block;
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    transform: translateY(-3px);
    color: var(--primary-light);
}

/* Contact Page */
.contact-info i {
    color: var(--primary-color);
}

.map-container {
    border-radius: 10px;
    overflow: hidden;
}

/* Blog */
.blog-post .post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark);
}

.blog-post .post-content p {
    margin-bottom: 1.5rem;
}

.blog-post .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem 0;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Donation Page */
.bank-details {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.5);
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 20px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-radius: 8px;
    margin: 0 0.25rem;
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--white);
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Desktop Navigation */
.desktop-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.desktop-nav .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
    padding: 0;
}

.desktop-nav .navbar-nav .nav-item {
    list-style: none;
}

/* Mobile Menu Overlay */
/* Mobile Menu Overlay - Full Screen from Right */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    visibility: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateX(0);
    transform: translateX(0);
}

.mobile-menu-overlay.active {
    right: 0;
    visibility: visible;
    -webkit-transform: translateX(0);
    transform: translateX(0);
}

.mobile-menu-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-logo-img {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-close:hover {
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.mobile-menu-item {
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.4s ease forwards;
}

.mobile-menu-overlay.active .mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-overlay.active .mobile-menu-item:nth-child(7) { animation-delay: 0.4s; }

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-link {
    display: block;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid transparent;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    transform: translateX(10px);
    padding-left: 2rem;
}

.mobile-menu-donate {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-color) !important;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
}

.mobile-menu-donate:hover {
    background-color: #fff !important;
    color: var(--primary-dark) !important;
    transform: scale(1.05);
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .stat-box h2 {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.fade-in.animated {
    opacity: 1;
}

/* Slide Up Animation */
.slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-up.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Slide In From Left */
.slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-left.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Slide In From Right */
.slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale In Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delay Classes (for multiple elements) */
.animate-delay-1 {
    transition-delay: 0.1s;
}

.animate-delay-2 {
    transition-delay: 0.2s;
}

.animate-delay-3 {
    transition-delay: 0.3s;
}

.animate-delay-4 {
    transition-delay: 0.4s;
}

.animate-delay-5 {
    transition-delay: 0.5s;
}

.animate-delay-6 {
    transition-delay: 0.6s;
}

/* Section Title Animation */
.section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-title.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Card Animation */
.card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Initial page load - hide animated elements until page is ready */
body:not(.page-loaded) section h2:not(.no-animate),
body:not(.page-loaded) section h3:not(.no-animate),
body:not(.page-loaded) .section-title:not(.no-animate),
body:not(.page-loaded) section .card:not(.no-animate),
body:not(.page-loaded) .animate-on-scroll,
body:not(.page-loaded) .fade-in:not(.animated),
body:not(.page-loaded) .slide-up:not(.animated),
body:not(.page-loaded) .slide-left:not(.animated),
body:not(.page-loaded) .slide-right:not(.animated),
body:not(.page-loaded) .scale-in:not(.animated) {
    opacity: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right,
    .scale-in,
    .section-title,
    .card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    display: flex;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1rem;
    }
}

/* Admin Styles (will be in separate file, but adding basic overrides) */
.admin-sidebar {
    background-color: var(--dark);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

