/* 
 * Main CSS for Sheikh Yahya Ibrahim Khalil Foundation Website
 * Author: Cascade AI
 * Version: 1.0
 */

/* Global Styles */
:root {
    --primary-color: #1e3a8a; /* Dark blue */
    --secondary-color: #3b82f6; /* Medium blue */
    --accent-color: #93c5fd; /* Light blue accent */
    --light-color: #f0f9ff; /* Light background */
    --dark-color: #0f172a; /* Very dark blue */
    --success-color: #0891b2; /* Teal success */
    --danger-color: #dc2626; /* Red for danger */
    --warning-color: #f59e0b; /* Amber for warning */
    --info-color: #3b82f6; /* Blue for info */
    --primary-gradient: linear-gradient(135deg, #1a5276 0%, #154360 100%);
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--light-color);
    color: #333;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    will-change: color;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

a:hover {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-out;
}

/* Header & Navigation */
.navbar {
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: linear-gradient(to left, #ffffff, #f8f9fa);
    border-bottom: 3px solid var(--primary-color);
}

.navbar-brand {
    position: relative;
    padding: 0.25rem 0;
}

.navbar-brand img {
    max-height: 60px;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
    transition: transform 0.2s ease-out;
}

.navbar-brand:hover img {
    transform: scale(1.03) translateZ(0);
}

.navbar-nav .nav-link {
    color: var(--dark-color);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    position: relative;
    margin: 0 0.15rem;
    border-radius: 5px;
    will-change: color, background-color, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    transition: color 0.2s ease-out, background-color 0.2s ease-out;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(26, 82, 118, 0.05);
}

.navbar-nav .nav-link.active::after,
.navbar-nav .nav-link:hover::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 3px;
    background-color: var(--primary-color);
    bottom: 5px;
    left: 15%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    will-change: transform, background-color, color;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
    transition: transform 0.2s ease-out, background-color 0.2s ease-out, color 0.2s ease-out;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(26, 82, 118, 0.1);
    color: var(--primary-color);
    transform: translateX(-2px) translateZ(0);
}

/* Hero Section with Slider */
.hero-slider {
    margin-bottom: 0;
    position: relative;
}

.hero-slide {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 600px;
    position: relative;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7));
}

.hero-content {
    position: relative;
    z-index: 10;
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-logo {
    max-width: 180px;
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.5rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.carousel-control-prev, .carousel-control-next {
    width: 5%;
}

.carousel-indicators {
    margin-bottom: 2rem;
}

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

/* Welcome Section */
.welcome-content {
    padding: 2rem 0;
}

.welcome-image img {
    max-width: 100%;
    border: 10px solid white;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    background-color: #fff;
    border-bottom: 3px solid var(--primary-color);
}

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

.shadow-sm {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-title {
    font-weight: 700;
    color: var(--primary-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
}

/* Featured Items */
.featured-item {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
}

/* Sections */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.bg-light-gray {
    background-color: #f5f7fa;
}

.bg-white {
    background-color: #ffffff;
}

.section-padding {
    padding: 4rem 0;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(26, 82, 118, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #154360 0%, #1a5276 100%);
    border: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 82, 118, 0.3);
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #1a5276 0%, #154360 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
    border-bottom: 3px solid #f39c12;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header .breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
    justify-content: center;
}

.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-header .breadcrumb-item a:hover {
    color: #f39c12;
}

.page-header .breadcrumb-item.active {
    color: #f39c12;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
}

/* Search Form */
.search-form {
    max-width: 100%;
    margin: 0 auto;
}

.search-input {
    border-radius: 30px;
    padding-right: 20px;
    padding-left: 20px;
}

.search-auth-bar {
    background-color: var(--light-color);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 0.75rem 0;
}

.search-form .input-group {
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.search-form .form-control {
    border-radius: 30px 0 0 30px;
    border: 1px solid #e0e0e0;
    border-right: none;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    height: 50px;
}

.search-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

.search-form .btn {
    border-radius: 0 30px 30px 0;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    height: 50px;
}

.search-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 82, 118, 0.2);
}

.auth-section {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.auth-buttons {
    display: inline-flex;
    align-items: center;
}

.auth-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.navbar .btn-outline-primary, 
.navbar .btn-primary {
    padding: 0.5rem 1.25rem;
    margin-right: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.navbar .btn-primary {
    box-shadow: 0 4px 8px rgba(26, 82, 118, 0.2);
}

.navbar .btn-primary:hover {
    box-shadow: 0 6px 12px rgba(26, 82, 118, 0.3);
}

/* Live Stream Section */
.live-stream-section {
    background: linear-gradient(rgba(245, 247, 250, 0.9), rgba(245, 247, 250, 0.9)), url('/static/img/default/pattern-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.live-badge {
    background-color: var(--danger-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-weight: 700;
}

.countdown {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Technical Projects Section */
.technical-projects-section {
    background: linear-gradient(rgba(245, 247, 250, 0.9), rgba(245, 247, 250, 0.9)), url('/static/img/default/tech-pattern.jpg');
    background-size: cover;
    background-position: center;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    padding: 0;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.back-to-top i {
    font-size: 18px;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

footer a {
    color: white;
    opacity: 0.8;
    transition: all 0.3s ease;
}

footer a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    text-align: center;
    line-height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Media Queries */
@media (max-width: 992px) {
    .navbar-nav .nav-link.active::after,
    .navbar-nav .nav-link:hover::after {
        width: 30%;
        left: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
}

/* Custom Classes */
.text-primary {
    color: var(--primary-color) !important;
}

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

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

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

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

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

/* Audio/Video Player */
.audio-player, .video-player {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}

/* Category Pills */
.category-pill {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: var(--light-color);
    color: var(--dark-color);
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.category-pill:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Search Results */
.search-highlight {
    background-color: rgba(243, 156, 18, 0.2);
    padding: 0 0.25rem;
}

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

.pagination .page-link {
    color: var(--primary-color);
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.progress-bar {
    background-color: var(--accent-color);
}

/* RTL Specific */
.dropdown-menu-end {
    left: 0;
    right: auto;
}

/* Fatwa Styles */
.fatwa-question {
    background-color: #f8f9fa;
    border-right: 3px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
}

.fatwa-answer {
    background-color: #fff;
    border-right: 3px solid var(--accent-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
}

/* Book Styles */
.book-cover {
    max-width: 250px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

/* Course Styles */
.course-progress {
    margin: 1rem 0;
}

.lesson-list {
    list-style: none;
    padding-right: 0;
}

.lesson-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.lesson-item:hover {
    background-color: #f8f9fa;
}

.lesson-item.active {
    background-color: rgba(26, 82, 118, 0.1);
    border-right: 3px solid var(--primary-color);
}

.lesson-item i {
    margin-left: 0.5rem;
    color: var(--accent-color);
}

/* Live Stream */
.live-badge {
    display: inline-block;
    background-color: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Dashboard */
.dashboard-card {
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card-primary {
    background-color: var(--primary-color);
    color: white;
}

.dashboard-card-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.dashboard-card-accent {
    background-color: var(--accent-color);
    color: white;
}

.dashboard-card-light {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.dashboard-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Authentication Pages */
.auth-container {
    padding: 3rem 0;
    background-color: #f8f9fa;
    background-image: url('/static/img/pattern-bg.png');
    background-size: 200px;
    background-repeat: repeat;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 82, 118, 0.9) 0%, rgba(46, 134, 193, 0.8) 100%);
    z-index: 1;
}

.auth-container .container {
    position: relative;
    z-index: 2;
}

.auth-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid var(--accent-color);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.auth-logo {
    max-width: 120px;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-title {
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

.auth-title::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background-color: var(--accent-color);
    bottom: -8px;
    left: 25%;
    border-radius: 3px;
}

.auth-body {
    padding: 1rem 0 2rem;
}

.auth-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.auth-footer a {
    color: var(--secondary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline !important;
}

.social-btn {
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #777;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.divider span {
    padding: 0 1rem;
    font-weight: 500;
}

/* Form styling for auth pages */
.auth-form .form-control {
    border-radius: 50px;
    padding: 0.85rem 1.25rem;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-size: 1rem;
    background-color: rgba(248, 249, 250, 0.8);
}

.auth-form .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(243, 156, 18, 0.25);
    background-color: #fff;
}

.auth-form .input-group-text {
    border-radius: 50px 0 0 50px;
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
    padding: 0.85rem 1.25rem;
}

.auth-form .btn-primary {
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.auth-form .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #154360 0%, #1a5276 100%);
    transition: opacity 0.3s ease;
    opacity: 0;
    z-index: -1;
}

.auth-form .btn-primary:hover::before {
    opacity: 1;
}

.auth-form .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.auth-form .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.auth-form .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.auth-form .form-check-label {
    padding-right: 0.5rem;
    font-weight: 500;
}

.auth-form .alert {
    border-radius: 15px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.auth-form .alert-danger {
    background-color: rgba(192, 57, 43, 0.1);
    color: #c0392b;
    border-right: 4px solid #c0392b;
}

.auth-form .alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
    border-right: 4px solid #27ae60;
}

.auth-form .alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-right: 4px solid #3498db;
}

.auth-form .alert-warning {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
    border-right: 4px solid #f39c12;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #e0e0e0;
    color: #6c757d;
    transition: all 0.3s ease;
}

.shadow {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

.rounded-lg {
    border-radius: 10px !important;
}

.bg-light-gray {
    background-color: #f8f9fa;
}

.bg-white {
    background-color: #fff;
}

.text-muted {
    color: #6c757d !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.overflow-hidden {
    overflow: hidden !important;
}
