/* Custom CSS for Majlis Ibrahim Jassim Sabat */

/* Global Styles */
:root {
    --primary-color: #dc2626;
    --secondary-color: #991b1b;
    --accent-color: #fbbf24;
    --text-color: #1f2937;
    --light-bg: #fef2f2;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Amiri', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    direction: rtl;
    text-align: right;
}

/* Ensure all images are visible */
img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Amiri', serif;
    font-weight: 700;
}

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

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    margin: 0 auto 2rem;
    border-radius: 2px;
}

/* Navigation */
.navbar {
    background: rgba(220, 38, 38, 0.95) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    transition: background-image 0.3s ease;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hero loading state */
.hero-section:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* When image is loading */
.hero-section.loading:before {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
}



/* Cards */
.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

.son-card .card-body {
    padding: 2rem;
}

.son-card i {
    transition: all 0.3s ease;
}

.son-card:hover i {
    transform: scale(1.1);
    color: var(--accent-color) !important;
}

.achievement-card .card-body {
    padding: 2rem;
}

.achievement-card i {
    transition: all 0.3s ease;
}

.achievement-card:hover i {
    transform: scale(1.1);
}

/* About Image */
.about-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Gallery */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    z-index: 1;
}

.gallery-item img {
    transition: all 0.3s ease;
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
    position: relative !important;
    z-index: 5 !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.gallery-item:hover img {
    transform: scale(1.05);
    z-index: 6 !important;
}

.gallery-item .gallery-caption {
    position: relative;
    z-index: 7;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 10px 10px;
}

/* Fix overlay issues */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 38, 38, 0.8);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
    z-index: 3;
}

.gallery-item::after {
    content: '\f065';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Ensure gallery section is properly positioned */
#gallery {
    position: relative;
    z-index: 1;
}

#gallery-content {
    position: relative;
    z-index: 2;
}

/* Loading placeholder fixes */
.loading-placeholder {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
}

/* Achievement card fixes */
.achievement-card {
    position: relative;
    z-index: 1;
    background: white !important;
}

.achievement-card .achievement-icon i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* News Cards */
.news-card .card-img-top {
    height: 200px;
    object-fit: cover;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.news-card:hover .card-img-top {
    transform: scale(1.05);
}

.news-image-container {
    position: relative;
    overflow: hidden;
}

.news-source-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.news-item-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color);
}

.news-card .btn-primary {
    font-size: 0.875rem;
    padding: 8px 16px;
}

/* News Sources */
.news-sources .badge {
    font-size: 0.85rem;
    padding: 8px 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.news-sources .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Video Cards */
.video-card {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    height: 250px;
    object-fit: cover;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 38, 38, 0.9);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    background: var(--accent-color);
    transform: translate(-50%, -50%) scale(1.1);
}

/* YouTube Video Cards */
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.video-card:hover .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
}

.video-stats {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-stats span {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.video-stats .views {
    background: rgba(220, 38, 38, 0.9);
}

.video-stats .duration {
    background: rgba(0, 0, 0, 0.9);
}

/* YouTube Channel Button */
.btn-danger {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border: none;
    font-weight: 600;
    padding: 12px 30px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #cc0000, #990000);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.3);
}

/* Loading States */
.loading-videos {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Video Modal */
.ratio {
    --bs-aspect-ratio: 56.25%;
}

#videoModal .modal-dialog {
    max-width: 90vw;
}

#videoModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.4);
    color: white;
}

/* Sections */
section {
    padding: 5rem 0;
}

/* Remove padding from hero section */
.hero-section {
    padding: 0 !important;
}

/* Ensure no margin between hero and next section */
#about {
    margin-top: 0 !important;
}

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

/* Override Bootstrap's bg-primary with Bahrain red */
.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Mission and Vision Sections */
.mission-content, .vision-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Enhanced Vision Section */
.vision-content {
    max-width: 100%;
}

.vision-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
}

.vision-content .lead {
    font-size: 1.3rem;
    font-weight: 500;
}

.vision-content strong {
    font-weight: 700;
    font-size: 1.15rem;
}

.vision-content hr {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* Management Section */
.management-content {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,249,250,0.95));
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.management-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    z-index: 1;
}

.management-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

.management-content .card-body {
    position: relative;
}

.management-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.management-content .lead {
    font-size: 1.3rem;
    font-weight: 500;
}

.management-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.management-content em {
    color: var(--accent-color);
    font-style: normal;
    font-weight: 600;
}

/* Enhanced Management Section Card */
.management-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.management-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 1;
}

.management-section:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.2);
}

.management-section .section-icon {
    position: relative;
    z-index: 2;
}

.management-section .section-icon i {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(220, 38, 38, 0.2));
}

.management-section .section-content {
    position: relative;
    z-index: 2;
}

.management-section .section-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}

.management-section .section-content .lead {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: var(--secondary-color) !important;
}

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color) !important;
    transform: translateY(-3px);
}

/* Enhanced Modal */
.modal-content {
    border-radius: 15px;
    border: none;
    background: #000 !important;
}

.modal-xl {
    max-width: 90vw;
}

.modal-main-image {
    max-height: 70vh;
    width: auto;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-nav-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    right: 20px;
}

.modal-next {
    left: 20px;
}

.image-counter {
    font-weight: 600;
    font-size: 1.1rem;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.modal-body {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal animations */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 95vw;
    }
    
    .modal-main-image {
        max-height: 60vh;
    }
    
    .modal-nav-btn {
        width: 50px;
        height: 50px;
    }
    
    .modal-prev {
        right: 10px;
    }
    
    .modal-next {
        left: 10px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .video-thumbnail img {
        height: 200px;
    }
    
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 0.5rem 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

