/* ===== style.css - جمعية القرى التراثية التعاونية ===== */
/* ===== النسخة النهائية - منظمة ومرتبة ===== */

/* ===== المتغيرات والإعدادات الأساسية ===== */
:root {
    --primary-color: #502b32;        /* اللون الأساسي من الشعار */
    --secondary-color: #d45c41;      /* اللون الثانوي من الشعار */
    --accent-color: #B23B3B;         /* أحمر ترابي */
    --light-bg: #F8F9FA;
    --dark-text: #333;
    --white: #fff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.15);
    --transition: 0.3s ease;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    color: var(--dark-text);
    line-height: 1.6;
    background-color: #fdfdfd;
}

/* ===== الأقسام العامة ===== */
.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 70px;
    height: 3px;
    background: var(--secondary-color);
}

.section-title.text-center::after {
    display: none;
}

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

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

/* ===== شريط الترخيص ===== */
.license-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--secondary-color);
}

.license-bar i {
    color: var(--secondary-color);
    margin-left: 5px;
}

.license-text {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 15px;
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    white-space: nowrap;
}

.date-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.weekday, .hijri-date {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.weekday {
    font-weight: 600;
}

/* ===== شريط التنقل (Navbar) ===== */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    padding: 15px 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-brand img {
    border-radius: 8px;
    max-height: 50px;
}

.navbar-nav .nav-link {
    color: var(--dark-text);
    font-weight: 600;
    margin: 0 10px;
    transition: var(--transition);
    position: relative;
}

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

/* إزالة الخط السفلي من روابط القائمة */
.navbar-nav .nav-link::after {
    display: none;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 10px 25px;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* ===== قسم الهيرو بفيديو الخلفية ===== */
.video-hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(79, 44, 51, 0.85) 0%,
        rgba(212, 92, 65, 0.75) 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-btn {
    animation: fadeInUp 1s ease 0.4s both;
    border-width: 2px;
    font-size: 1.2rem;
    padding: 12px 35px;
}

.hero-btn:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* مؤشر التمرير */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator a {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 50px;
    position: relative;
    opacity: 0.8;
    transition: var(--transition);
}

.scroll-indicator a:hover {
    opacity: 1;
    transform: scale(1.1);
}

.scroll-indicator span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--white);
    margin: 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2s infinite;
}

.scroll-indicator span:nth-child(1) { top: 8px; animation-delay: 0s; }
.scroll-indicator span:nth-child(2) { top: 16px; animation-delay: 0.2s; }
.scroll-indicator span:nth-child(3) { top: 24px; animation-delay: 0.4s; }

/* ===== أنيميشنز ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollDown {
    0% { opacity: 0; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(10px); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

@keyframes tiltFadeIn {
    from { opacity: 0; transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) scale(0.9); }
    to { opacity: 1; transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1); }
}

/* ===== معرض الصور المتحرك ===== */
.gallery-carousel-container {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 20px;
    background: #f5f5f5;
}

#heritageCarousel {
    border-radius: var(--border-radius-lg);
}

.tilt-gallery .carousel-item {
    height: 400px;
    background-color: #000;
}

.gallery-img-tilt {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* مؤشرات الكاروسيل */
#heritageCarousel .carousel-indicators {
    bottom: 20px;
    z-index: 3;
}

#heritageCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--white);
    border: 2px solid var(--primary-color);
    opacity: 0.7;
    margin: 0 5px;
    transition: var(--transition);
}

#heritageCarousel .carousel-indicators button.active {
    opacity: 1;
    background-color: var(--secondary-color);
    border-color: var(--white);
    transform: scale(1.2);
}

/* أزرار التحكم */
.gallery-control {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.4s ease;
    margin: 0 20px;
}

.gallery-carousel-container:hover .gallery-control {
    opacity: 1;
}

.gallery-control:hover {
    background: var(--primary-color);
    border-color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.gallery-control .control-icon {
    color: var(--white);
    font-size: 1.5rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* النص التعريفي على الصور */
.carousel-caption-overlay {
    position: absolute;
    bottom: 60px;
    right: 30px;
    background: linear-gradient(90deg, 
        rgba(79, 44, 51, 0.9) 0%,
        rgba(212, 92, 65, 0.85) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    z-index: 2;
}

.carousel-item:hover .carousel-caption-overlay {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(79, 44, 51, 0.4);
    background: linear-gradient(90deg, 
        rgba(79, 44, 51, 0.95) 0%,
        rgba(212, 92, 65, 0.9) 100%);
    border-color: rgba(212, 92, 65, 0.5);
}

.tilt-gallery .carousel-item.active {
    animation: tiltFadeIn 0.8s ease forwards;
}

/* ===== قسم الأهداف ===== */
.objective-card {
    background: var(--white);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.objective-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--secondary-color);
    box-shadow: var(--shadow-hover);
}

.objective-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: var(--transition);
}

.objective-card:hover i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.objective-card h5 {
    font-weight: 600;
    color: var(--dark-text);
    margin-top: 10px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* ===== قسم العضوية ===== */
.condition-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 40px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.condition-item:hover {
    transform: scale(1.02);
    background: var(--primary-color);
    color: var(--white);
}

.condition-item i {
    font-size: 1.5rem;
    color: var(--secondary-color);
    width: 40px;
    text-align: center;
}

.condition-item:hover i {
    color: var(--white);
}

/* ===== قسم الانضمام ===== */
#join .join-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-xl);
    padding: 40px 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

#join .join-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

#join .join-icon {
    width: 90px;
    height: 90px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2.5rem;
    color: var(--primary-color);
    border: 4px solid var(--white);
    transition: var(--transition);
}

#join .join-card:hover .join-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--white);
}

#join .join-button {
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

#join .join-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: var(--secondary-color);
    color: var(--primary-color);
}

#join .text-white-50 {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ===== قسم مجلس الإدارة ===== */
.board-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    padding-bottom: 25px;
    height: 100%;
}

.board-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.board-img-wrapper {
    width: 180px;
    height: 180px;
    margin: 30px auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--secondary-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.board-card:hover .board-img-wrapper {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.board-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.board-card h5 {
    margin: 10px 0 5px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0 15px;
}

.board-card p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* تنسيقات رئيس مجلس الإدارة */
.president-card {
    border: 2px solid var(--secondary-color);
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
    position: relative;
    overflow: hidden;
}

.president-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.position-title {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* ===== قسم الفعاليات والأنشطة ===== */
#activities {
    background-color: #f9f9f9;
}

.activity-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    height: 100%;
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.activity-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--secondary-color);
    box-shadow: var(--shadow-hover);
}

.activity-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--white);
    transition: var(--transition);
}

.activity-card:hover .activity-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(212, 92, 65, 0.3);
}

.activity-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.activity-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===== قسم التواصل ===== */
.contact-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
}

.contact-info {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    height: 100%;
}

.contact-info:hover {
    background: var(--light-bg);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    background: rgba(80, 43, 50, 0.1);
    padding: 20px;
    border-radius: 50%;
    transition: var(--transition);
}

.contact-info:hover .contact-icon {
    background: var(--primary-color);
    color: var(--white);
}

.contact-info h5 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.contact-info p {
    color: #666;
    margin-bottom: 5px;
}

.direction-ltr {
    direction: ltr;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-text);
    background: var(--light-bg);
    padding: 10px;
    border-radius: var(--border-radius-xl);
    border: 1px dashed var(--secondary-color);
}

.contact-note {
    background: rgba(212, 92, 65, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-right: 4px solid var(--secondary-color);
}

.contact-note i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* ===== الفوتر ===== */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 50px 0 20px;
    border-top: 5px solid var(--secondary-color);
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.contact-link {
    color: var(--secondary-color);
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--white);
}

/* ===== زر العودة للأعلى ===== */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background: var(--secondary-color);
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

#back-to-top:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* ===== تحسينات الجوال وإصلاح مشكلة الروابط ===== */

/* تحسين شريط الترخيص للجوال */
@media (max-width: 768px) {
    .license-bar {
        font-size: 0.8rem;
    }
    
    .license-bar .col-6 {
        width: 100%;
        text-align: center !important;
        margin: 3px 0;
    }
    
    .license-bar .row {
        flex-direction: column;
    }
    
    .license-text, 
    .date-wrapper {
        background: transparent;
        border: none;
        padding: 0;
        white-space: normal;
        justify-content: center;
    }
    
    .date-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}

/* إصلاح مشكلة الروابط في الجوال */
@media (max-width: 991.98px) {
    html {
        scroll-padding-top: 700px; /* تعويض ارتفاع النافبار */
    }
    
    .navbar-collapse {
        background: var(--white);
        padding: 20px;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        margin-top: 10px;
        border: 1px solid rgba(0,0,0,0.05);
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        text-align: center;
        margin-bottom: 15px !important;
    }
    
    .navbar-nav .nav-item {
        margin: 5px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 0;
        margin: 0;
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: var(--light-bg);
        border-radius: 8px;
        padding: 12px 15px;
    }
    
    .btn-primary {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px;
        margin-top: 5px;
    }
}

/* تحسينات عامة للجوال */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-btn {
        font-size: 1rem;
        padding: 10px 25px;
    }
    
    .tilt-gallery .carousel-item {
        height: 300px;
    }
    
    .gallery-control {
        width: 40px;
        height: 40px;
        margin: 0 10px;
    }
    
    .gallery-control .control-icon {
        font-size: 1.2rem;
    }
    
    .carousel-caption-overlay {
        bottom: 50px;
        right: 15px;
        font-size: 0.9rem;
        padding: 5px 15px;
    }
    
    .board-img-wrapper {
        width: 140px;
        height: 140px;
    }
    
    .contact-card {
        padding: 25px;
    }
    
    .direction-ltr {
        font-size: 0.95rem;
        word-break: break-all;
    }
    
    .activity-card {
        padding: 25px 15px;
    }
    
    .activity-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .activity-card h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tilt-gallery .carousel-item {
        height: 250px;
    }
    
    .carousel-caption-overlay {
        bottom: 45px;
        font-size: 0.8rem;
    }
    
    .activity-card {
        padding: 20px 12px;
    }
    
    .activity-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* تحسين الأداء للفيديو */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }
    
    .video-hero {
        background-image: url('images/hero-bg1.jpg');
        background-size: cover;
        background-position: center;
    }
}

/* دعم المتصفحات القديمة */
.no-video .video-hero {
    background-image: url('images/hero-bg1.jpg');
    background-size: cover;
    background-position: center;
}