/* ============================================
   SaidaPost - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #dc3545;
    --secondary-color: #6c757d;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bs-info: #6f42c1; /* Purple color for info */
    --bs-info-rgb: 111, 66, 193;
    --bs-info-text-emphasis: #4a2d85;
    --bs-info-bg-subtle: #e7dff5;
    --bs-info-border-subtle: #cfb8eb;
}

/* Font Family - Cairo for everything */
body, *, h1, h2, h3, h4, h5, h6, .navbar-brand, input, textarea, select, button {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-weight: 700;
}

/* Smooth font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================
   Navigation
   ============================================ */

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 80px 0;
    position: relative;
    z-index: 1;
}


/* ============================================
   Hero Image Section
   ============================================ */

.hero-image-section {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    z-index: 1;
}

@media (min-width: 576px) {
    .hero-image-section {
        height: 300px;
    }
}

@media (min-width: 768px) {
    .hero-image-section {
        height: 400px;
    }
}

@media (min-width: 992px) {
    .hero-image-section {
        height: 500px;
    }
}

.hero-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Category Header
   ============================================ */

/* Category header as overlay on hero image */
.category-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    mix-blend-mode: multiply;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: white;
    padding: 60px 0;
}

.category-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* ============================================
   Article Cards
   ============================================ */

.article-card {
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.article-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

/* ============================================
   Featured Article
   ============================================ */

.featured-article {
    position: relative;
    overflow: hidden;
}

.featured-article img {
    height: 400px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.5s;
}

.featured-article:hover img {
    transform: scale(1.1);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px;
    color: white;
    pointer-events: none;
}

.featured-overlay a,
.featured-overlay .badge {
    pointer-events: auto;
}

/* ============================================
   Featured Carousel
   ============================================ */

.featured-carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.carousel-container {
    display: flex;
    transition: transform 0.6s ease-in-out;
}

.featured-article-carousel {
    position: relative;
    min-height: 300px;
    border-radius: 10px;
    overflow: hidden;
}

@media (min-width: 576px) {
    .featured-article-carousel {
        min-height: 400px;
    }
}

@media (min-width: 768px) {
    .featured-article-carousel {
        min-height: 500px;
    }
}

.featured-carousel-image {
    height: 300px;
    object-fit: cover;
    display: block;
}

@media (min-width: 576px) {
    .featured-carousel-image {
        height: 400px;
    }
}

@media (min-width: 768px) {
    .featured-carousel-image {
        height: 500px;
    }
}

.featured-carousel-placeholder {
    height: 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

@media (min-width: 576px) {
    .featured-carousel-placeholder {
        height: 400px;
    }
}

@media (min-width: 768px) {
    .featured-carousel-placeholder {
        height: 500px;
    }
}

.featured-carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: white;
    z-index: 10;
}

@media (min-width: 576px) {
    .featured-carousel-overlay {
        padding: 30px;
    }
}

@media (min-width: 768px) {
    .featured-carousel-overlay {
        padding: 40px;
    }
}

.form-label {
    font-weight: 600;
    color:#7c04ac;
    margin-bottom: 0.2rem;
  }
.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #7c04ac;
}
.form-section h5 {
    color: #000000;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #7c04ac41;
}
.featured-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
}

@media (min-width: 576px) {
    .featured-badge {
        font-size: 0.85rem;
        padding: 0.45rem 0.9rem;
    }
}

@media (min-width: 768px) {
    .featured-badge {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

.featured-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 0.15rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

@media (min-width: 576px) {
    .featured-title {
        font-size: 2rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .featured-title {
        font-size: 2.5rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 992px) {
    .featured-title {
        font-size: 3rem;
    }
}

.featured-excerpt {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

@media (min-width: 576px) {
    .featured-excerpt {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .featured-excerpt {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

.featured-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
}

@media (min-width: 576px) {
    .featured-meta {
        gap: 1rem;
        margin-top: 1rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    .featured-meta {
        gap: 1.5rem;
        margin-top: 1rem;
        font-size: 1rem;
    }
}

.carousel-indicators-wrapper {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    gap: 8px;
}

@media (min-width: 768px) {
    .carousel-indicators-wrapper {
        bottom: 20px;
        gap: 10px;
    }
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
}

@media (min-width: 768px) {
    .carousel-indicator {
        width: 12px;
        height: 12px;
    }
}

.carousel-indicator[style*="white"] {
    background: white !important;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.3s;
}

.carousel-btn:hover {
    background: rgba(0,0,0,0.7);
}

@media (min-width: 768px) {
    .carousel-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.carousel-prev {
    left: 10px;
}

@media (min-width: 768px) {
    .carousel-prev {
        left: 20px;
    }
}

.carousel-next {
    right: 10px;
}

@media (min-width: 768px) {
    .carousel-next {
        right: 20px;
    }
}


/* ============================================
   Article Page
   ============================================ */

.article-header {
    background: var(--gradient-primary);
    color: white;
    padding: 60px 0;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

/* ============================================
   Social Share Buttons
   ============================================ */

.social-share {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-share a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
}

.social-share a:hover {
    transform: scale(1.1);
}

.fb-share { 
    background-color: #1877f2; 
}

.twitter-share { 
    background-color: #1da1f2; 
}

.linkedin-share { 
    background-color: #0077b5; 
}

.whatsapp-share { 
    background-color: #25d366; 
}

.telegram-share { 
    background-color: #0088cc; 
}

.email-share { 
    background-color: #6c757d; 
}

/* ============================================
   Login/Register Pages
   ============================================ */

.login-page-body,
.register-page-body {
    background: var(--gradient-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container,
.register-container,
.forgot-password-container,
.reset-password-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
}

.forgot-password-container,
.reset-password-container {
    max-width: 500px;
    padding: 40px;
}

.login-left,
.register-left {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    .login-left,
    .register-left {
        padding: 60px;
    }
}

.login-right,
.register-right {
    padding: 40px 30px;
}

@media (min-width: 768px) {
    .login-right,
    .register-right {
        padding: 60px;
    }
}

.logo-container {
    margin-bottom: 20px;
    text-align: center;
}

@media (min-width: 768px) {
    .logo-container {
        margin-bottom: 30px;
    }
}

.logo-container img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
}

@media (min-width: 768px) {
    .logo-container img {
        max-height: 80px;
    }
}

.forgot-password-container .logo-container img,
.reset-password-container .logo-container img {
    max-height: 60px;
}

/* Force form fields to LTR even in RTL languages */
.login-right form,
.login-right .form-control,
.login-right .input-group,
.login-right .form-label,
.login-right .form-check-label,
.login-right input[type="text"],
.login-right input[type="password"],
.login-right input[type="email"],
.login-right .btn,
.register-right form,
.register-right .form-control,
.register-right .input-group,
.register-right .form-label,
.register-right .form-check-label,
.register-right input[type="text"],
.register-right input[type="password"],
.register-right input[type="email"],
.register-right .btn,
.forgot-password-container form,
.forgot-password-container .form-control,
.forgot-password-container input[type="email"],
.forgot-password-container .btn,
.reset-password-container form,
.reset-password-container .form-control,
.reset-password-container input[type="password"],
.reset-password-container .btn {
    direction: ltr !important;
    text-align: left !important;
}

/* Keep form labels and text in page direction */
.login-right .form-label,
.login-right .form-check-label,
.register-right .form-label,
.register-right .form-check-label,
.forgot-password-container .form-label,
.reset-password-container .form-label {
    text-align: right !important;
}

@media (max-width: 767.98px) {
    .login-left,
    .register-left {
        padding: 30px 20px;
        min-height: auto;
    }
    
    .login-left .logo-container img,
    .register-left .logo-container img {
        max-height: 50px;
    }
    
    .login-left .fa-4x,
    .register-left .fa-4x {
        font-size: 2.5rem !important;
    }
    
    .login-container .row {
        flex-direction: column;
    }
    
    .login-container .row > [class*="col-"] {
        width: 100%;
    }
    
    .login-right h2,
    .register-right h2 {
        font-size: 1.5rem;
    }
    
    .login-right .text-muted,
    .register-right .text-muted {
        font-size: 0.875rem;
    }
}

/* ============================================
   Footer
   ============================================ */

footer {
    background-color: #C0C0C0 !important; /* Silver */
    border-top: 3px solid rgba(0, 0, 0, 0.1);
    color: #333 !important;
}

footer.text-white {
    color: #333 !important;
}

footer a {
    transition: color 0.3s ease;
    color: #333;
}

footer a:hover {
    color: #000 !important;
}

footer .social-links a {
    transition: transform 0.3s ease;
}

footer .social-links a:hover {
    transform: translateY(-3px);
}

footer h5, 
footer h6 {
    color: #333;
    font-weight: 600;
}

footer .text-muted {
    color: #555 !important;
}

footer .list-unstyled li {
    transition: padding-right 0.2s ease;
}

footer .list-unstyled li:hover {
    padding-right: 5px;
}

/* ============================================
   Image Upload Container (Admin)
   ============================================ */

.image-upload-container {
    position: relative;
}

.image-upload-container .image-preview {
    width: 100%;
    max-width: 500px;
    height: 300px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    cursor: pointer;
    overflow: hidden;
}

.image-upload-container .image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ============================================
   Forms
   ============================================ */

/* Light grey background for forms */
form {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.card-body form {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: -15px;
}

/* Form controls styling */
.form-control,
.form-select,
textarea.form-control {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background-color: #ffffff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ============================================
   Utility Classes
   ============================================ */

.object-fit-cover {
    object-fit: cover;
}

/* LTR override for technical fields */
.ltr-field {
    direction: ltr !important;
    text-align: left !important;
}

/* Sticky Save Button for Settings Page */
.sticky-save-button {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid #dee2e6;
}

.sticky-save-button .d-grid {
    max-width: 50%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Note: Add padding-bottom: 100px to container in settings page to prevent content from being hidden behind sticky button */

/* ============================================
   Bootstrap Info Color Override (Purple)
   ============================================ */

/* Override Bootstrap info color with purple */
.bg-info {
    background-color: #6f42c1 !important;
}

.text-info {
    color: #6f42c1 !important;
}

.btn-info {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: #fff;
}

.border-info {
    border-color: #6f42c1 !important;
}

.alert-info {
    background-color: #e7dff5;
    border-color: #cfb8eb;
    color: #4a2d85;
}

.badge.bg-info {
    background-color: #6f42c1 !important;
}

/* Override Bootstrap CSS variables for info color */
[data-bs-theme="light"] {
    --bs-info: #6f42c1;
    --bs-info-rgb: 111, 66, 193;
    --bs-info-text-emphasis: #4a2d85;
    --bs-info-bg-subtle: #e7dff5;
    --bs-info-border-subtle: #cfb8eb;
}
