/**
 * Palestine Endowment Foundation
 * Main Stylesheet
 * Colors extracted from logo: Teal/Cyan gradient
 */

/* ==========================================
   CSS Variables (Theme Colors)
   ========================================== */
:root {
    /* Primary Colors - Teal/Cyan from logo */
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-rgb: 13, 148, 136;

    /* Secondary - Green */
    --secondary: #059669;
    --secondary-light: #10b981;
    --secondary-dark: #047857;

    /* Accent - Gradient */
    --gradient-primary: linear-gradient(135deg, #059669 0%, #0d9488 50%, #14b8a6 100%);
    --gradient-hero: linear-gradient(135deg, rgba(5, 150, 105, 0.9) 0%, rgba(13, 148, 136, 0.9) 100%);

    /* Neutral Colors */
    --dark: #1f2937;
    --gray-dark: #374151;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --gray-lighter: #e5e7eb;
    --light: #f3f4f6;
    --white: #ffffff;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    /* Fonts */
    --font-arabic: 'Tajawal', sans-serif;
    --font-english: 'Inter', sans-serif;
    --font-heading: 'Readex Pro', sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* ==========================================
   Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--white);
}

body.ltr {
    font-family: var(--font-english);
}

body.rtl {
    font-family: var(--font-arabic);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   Override Bootstrap Colors
   ========================================== */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.bg-primary {
    background: var(--gradient-primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

/* ==========================================
   Navbar
   ========================================== */
.navbar {
    padding: 0.2rem 0;
    transition: var(--transition);
}

.navbar-brand img {
    transition: var(--transition);
    height: 80px !important;
    max-height: 80px !important;
    width: auto !important;
}

.navbar-nav .nav-link {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero-section {
    position: relative;
    background: var(--gradient-hero);
    min-height: 600px;
}

/* Bootstrap Carousel in Hero */
.hero-section .carousel,
.hero-section .carousel-inner,
.hero-section .carousel-item {
    min-height: 600px;
}

.hero-section .carousel-item.active {
    display: flex;
    align-items: center;
}

/* Hero Slide */
.hero-slide {
    position: relative;
    width: 100%;
}

.hero-slide-fullbg {
    position: relative;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Hero Button */
.hero-btn {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--white);
    color: var(--primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
}

.hero-btn:hover {
    background: var(--light);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Carousel Controls */
.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    opacity: 0.8;
}

.hero-section .carousel-control-prev {
    left: 20px;
}

.hero-section .carousel-control-next {
    right: 20px;
}

.hero-section .carousel-control-prev:hover,
.hero-section .carousel-control-next:hover {
    background: rgba(255,255,255,0.4);
    opacity: 1;
}

.hero-section .carousel-indicators {
    bottom: 30px;
}

.hero-section .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

/* RTL Carousel Arrow Positions */
[dir="rtl"] .hero-section .carousel-control-prev {
    left: auto !important;
    right: 20px !important;
}

[dir="rtl"] .hero-section .carousel-control-next {
    right: auto !important;
    left: 20px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section,
    .hero-section .carousel,
    .hero-section .carousel-inner,
    .hero-section .carousel-item {
        min-height: 500px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-slide {
        padding: 60px 0 !important;
    }
}


/* ==========================================
   Section Styles
   ========================================== */
.section {
    padding: 5rem 0;
}

.section-light {
    background-color: var(--light);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

/* ==========================================
   About Section
   ========================================== */
.about-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.about-card {
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================
   Projects Section
   ========================================== */
.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.rtl .project-badge {
    right: auto;
    left: 1rem;
}

.project-body {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-progress {
    margin-bottom: 1rem;
}

.project-progress .progress {
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--gray-lighter);
    overflow: hidden;
}

.project-progress .progress-bar {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.project-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.project-stats .amount {
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   Donation Section
   ========================================== */
.donation-section {
    background: var(--gradient-hero);
    position: relative;
}

.donation-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.amount-btn {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}

.amount-btn:hover,
.amount-btn.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

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

/* ==========================================
   Stats Section
   ========================================== */
.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 1.5rem;
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ==========================================
   News/Posts Section
   ========================================== */
.post-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.rtl .post-category {
    right: auto;
    left: 1rem;
}

.post-body {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.post-title a {
    color: var(--text-primary);
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-meta i {
    color: var(--primary);
}

/* ==========================================
   Footer
   ========================================== */
footer {
    background-color: var(--dark);
}

footer h5 {
    color: var(--white);
    font-weight: 700;
}

footer a.hover-white:hover {
    color: var(--white) !important;
}

/* ==========================================
   Back to Top Button
   ========================================== */
#backToTop {
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   Form Styles
   ========================================== */
.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ==========================================
   Utilities
   ========================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.shadow-custom {
    box-shadow: var(--shadow-md);
}

/* ==========================================
   Loading Spinner
   ========================================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-lighter);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 991.98px) {
    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: 500px;
    }

    .donation-card {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* ==========================================
   Pagination - Smaller Size
   ========================================== */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.pagination .page-link:hover {
    color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
}

.pagination .page-item.disabled .page-link {
    color: var(--gray-light);
}
