:root {
    --primary: #0F172A;
    --accent: #F59E0B;
    --text: #334155;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --font-en: 'Inter', sans-serif;
    --font-ar: 'Cairo', sans-serif;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; /* Remove tap blue highlight on mobile */
}

html {
    height: -webkit-fill-available;
}

body { 
    font-family: var(--font-en); 
    background-color: var(--bg); 
    color: var(--text); 
    line-height: 1.6; 
    overflow-x: hidden; 
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Remove default focus outlines */
:focus {
    outline: none !important;
}

input, textarea, select, button, a {
    -webkit-appearance: none;
    appearance: none;
    outline: none !important;
}

.btn:focus, .form-control:focus, .reaction-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}
html[lang="ar"] body { font-family: var(--font-ar); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-md); }

.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; transition: 0.3s; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: var(--white); }
.btn.secondary { background: #e2e8f0; color: var(--primary); margin: 5px; }
.btn.success { background: var(--accent); color: var(--primary); }
.btn.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-delete { background: #e11d48; color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; margin-top: 10px; }

/* Navbar & Smart Header */
.navbar { 
    background: transparent; 
    backdrop-filter: blur(0px); 
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent; 
    padding: var(--spacing-md) 0; 
    position: sticky; /* Sticky prevents content from jumping up */
    top: 0;
    z-index: 1000; 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, padding 0.3s;
    width: 100%;
}

.scroll-down .navbar {
    transform: translateY(-100%);
}

.scroll-up .navbar {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: none;
    border-bottom: none;
    padding: 0.7rem 0;
}

/* Adapt for mobile floating design */
@media (max-width: 768px) {
    .navbar {
        position: sticky !important;
        top: 15px;
        width: 94%;
        margin: 0 auto;
        border-radius: 20px;
        /* Prevent overflow issues */
        left: 0;
        right: 0;
    }
    
    .scroll-down .navbar {
        transform: translateY(-150%);
    }
    
    .scroll-up .navbar {
        transform: translateY(0);
    }
}

.menu-toggle {
    display: none;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-size: 1.5rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1100;
    transition: 0.3s;
}
.menu-toggle:hover {
    background: var(--accent);
    color: var(--primary);
}

.navbar:hover {
    background: rgba(255, 255, 255, 0.05); /* Almost transparent */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.navbar .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
}

.site-logo-img {
    height: 95px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

.logo-edit-container {
    position: relative;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-edit-container .editable-media-wrapper {
    width: 240px;
    height: 240px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.logo-edit-container .editable-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.logo-text-fallback { 
    font-size: 1.1rem; 
    font-weight: 700; 
    opacity: 0.5; 
}

.navbar nav ul { 
    display: flex; 
    gap: var(--spacing-sm); 
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
}

.navbar nav ul li a {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    transition: all 0.3s ease;
    display: block;
    position: relative;
}

.navbar nav ul li a::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: 0.3s;
}

.navbar nav ul li a:hover {
    color: var(--accent);
}

.navbar nav ul li a:hover::after {
    transform: scaleX(1);
}

.navbar nav ul li a.active {
    color: var(--accent);
}

.navbar nav ul li a.active::after {
    transform: scaleX(1);
    background: var(--primary);
}

.actions { 
    display: flex; 
    gap: var(--spacing-md); 
    align-items: center; 
}

.lang-switch {
    font-weight: 700;
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--accent);
    font-size: 0.9rem;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.lang-switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.3);
}

.edit-toggle { 
    font-size: 0.8rem; 
    padding: 0.6rem 1rem; 
    border: 2px solid var(--primary); 
    border-radius: 8px; 
    background: transparent;
    font-weight: 700;
    color: var(--primary);
}

/* Hero */
.hero { padding: var(--spacing-lg) 0; background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); align-items: center; }
.hero-text h1 { font-size: 2.2rem; color: var(--primary); }
.background-edit-tool { margin-top: var(--spacing-lg); }
.hero-image { position: relative; max-height: 500px; width: 100%; overflow: hidden; border-radius: 12px; background: transparent; }
.hero-image img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* About Page */
.about { padding: var(--spacing-xl) 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-xl); align-items: center; }
.about-text h1 { font-size: 2.5rem; color: var(--primary); margin-bottom: 1.5rem; }
.about-content { font-size: 1.1rem; color: var(--text); line-height: 1.8; }
.about-image { border-radius: 12px; overflow: hidden; background: transparent; min-height: auto; }
.about-image img { width: 100%; height: auto; display: block; }

/* About Preview Section (Home) */
.about-preview { padding: var(--spacing-xl) 0; background: var(--white); }
.about-preview h2 { font-size: 2.2rem; color: var(--primary); margin-bottom: 1.5rem; }
.about-preview .about-grid { align-items: center; }
.about-preview .btn { margin-top: 1.5rem; }

@media (max-width: 768px) {
    .about-preview { text-align: center; }
    .about-preview .about-image { margin-bottom: 2rem; }
}

/* Dynamic Sections */
.dynamic-section { padding: var(--spacing-xl) 0; border-bottom: none; }
.dynamic-section h2 { font-size: 2rem; margin-bottom: 1rem; color: var(--primary); }
.section-media img { max-width: 100%; border-radius: 8px; display: block; }

/* Services */
.services { padding: var(--spacing-xl) 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--spacing-lg); }
.card { background: var(--white); padding: var(--spacing-lg); border-radius: 8px; box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column; cursor: pointer; transition: 0.3s; height: 100%; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

.card-footer {
    margin-top: auto;
    padding-top: 15px;
}

.btn-view-more {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-more:hover {
    background: var(--accent);
    color: var(--primary);
}

/* Gallery System */
.gallery-viewport { width: 100%; overflow: hidden; border-radius: 8px; background: #eee; margin-bottom: 15px; position: relative; }
.service-gallery { display: flex; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); width: 100%; }
.gallery-item-wrapper { flex: 0 0 100%; position: relative; overflow: hidden; aspect-ratio: 16/9; }
.gallery-img, .gallery-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-controls { display: flex; gap: 10px; margin-bottom: 15px; }

/* Revert to grid in Edit Mode */
body.edit-mode-active .service-gallery { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; transform: none !important; }
body.edit-mode-active .gallery-viewport { overflow: visible; }
body.edit-mode-active .gallery-item-wrapper { flex: none; aspect-ratio: 4/3; }

/* Media Controls */
.editable-media-wrapper { width: 100%; height: 100%; position: relative; }
.media-controls { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; opacity: 0; transition: 0.3s; z-index: 10; }
body.edit-mode-active .media-controls { opacity: 1 !important; }
.editable-media-wrapper:hover .media-controls { opacity: 1; }
.btn-edit-media { background: var(--accent); color: var(--primary); border: none; padding: 6px 12px; font-size: 0.85rem; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-delete-media-inline { background: #e11d48; color: #fff; border: none; padding: 6px 12px; font-size: 0.85rem; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-delete-media { position: absolute; top: 5px; right: 5px; background: #e11d48; color: #fff; border: none; width: 20px; height: 20px; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; display: flex; justify-content: center; align-items: center; }

/* Modal & Lightbox */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }
.modal-content { 
    background-color: var(--white); 
    margin: 5vh auto; 
    padding: 40px; 
    border-radius: 12px; 
    width: 80%; 
    max-width: 900px; 
    position: relative; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2); 
    max-height: 90vh;
    overflow-y: auto;
}

/* Global scrollbar for modal content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.close-modal { 
    position: sticky; 
    top: -20px; 
    float: right;
    color: #aaa; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.3s; 
    z-index: 100; 
    margin-top: -20px;
    margin-right: -20px;
}
.close-modal:hover { color: var(--primary); }
.modal-description { margin-top: 20px; font-size: 1.1rem; line-height: 1.8; color: var(--text); }

/* Modal Gallery */
.modal-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0; }
.modal-gallery-img, .modal-gallery-video { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; transition: 0.3s; background: #eee; }
.modal-gallery-img:hover { transform: scale(1.05); }

/* Lightbox Extras */
.lightbox { display: none; align-items: center; justify-content: center; background-color: rgba(0,0,0,0.9); overflow: hidden; touch-action: none; }
.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.lightbox img, .lightbox video { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain;
    border-radius: 4px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-drag: none;
}
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); color: white; border: none; font-size: 40px; padding: 20px; cursor: pointer; transition: 0.3s; border-radius: 4px; z-index: 2100; }
.nav-btn:hover { background: rgba(255,255,255,0.2); }
.nav-btn.prev { left: 20px; }
.nav-btn.next { right: 20px; }

/* Admin Specific */
.admin-full-desc { margin-top: 20px; padding: 15px; background: #f1f5f9; border-radius: 8px; display: none; text-align: left; }
body.edit-mode-active .admin-full-desc { display: block; }
.admin-full-desc label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.8rem; color: #64748b; }
.admin-full-desc .editable { background: #fff; min-height: 60px; padding: 10px; margin-bottom: 10px; border: 1px solid var(--border); }

.admin-tools { margin-top: 30px; text-align: center; border-top: 1px dashed var(--border); padding-top: 20px; }
.editor-toolbar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--primary); color: var(--white); padding: 1rem; display: flex; justify-content: space-between; align-items: center; z-index: 3000; }

/* Reviews Page */
.reviews { padding: var(--spacing-xl) 0; background: transparent; }
.reviews-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
.review-item { 
    background: var(--white); 
    padding: 30px; 
    border-radius: 16px; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05); 
    border: 1px solid rgba(226, 232, 240, 0.5);
    position: relative; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.review-item:hover { transform: translateY(-10px); box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1); border-color: var(--accent); }

.review-item::before {
    content: "“";
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 5rem;
    color: var(--accent);
    opacity: 0.15;
    font-family: serif;
    line-height: 1;
}
html[lang="ar"] .review-item::before { right: auto; left: 25px; }

.review-info { position: relative; z-index: 1; }
.review-name { font-size: 1.25rem; color: var(--primary); font-weight: 700; margin-bottom: 4px; }
.review-role { font-size: 0.9rem; color: #64748b; font-weight: 600; margin-bottom: 15px; display: block; }

.review-stars { color: #f59e0b; margin-bottom: 15px; font-size: 1.1rem; display: flex; gap: 2px; }
.review-stars .star.empty { color: #e2e8f0; }

.review-text p { color: var(--text); line-height: 1.7; font-size: 1.05rem; font-style: normal; }

.review-admin-actions { 
    margin-top: 20px; 
    padding-top: 15px; 
    border-top: 1px solid #f1f5f9; 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
}

/* Star Rating Input */
.star-rating-input { display: flex; gap: 8px; font-size: 1.5rem; color: #e2e8f0; cursor: pointer; margin-bottom: 10px; }
.star-rating-input .star.active { color: #f59e0b; }
.star-rating-input .star:hover { transform: scale(1.2); }

/* Review Edit Form */
.review-edit-form { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-weight: 700; font-size: 0.85rem; color: #64748b; }
.form-group .editable { background: #f8fafc; border: 1px solid var(--border); padding: 12px; border-radius: 6px; min-height: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .review-item { flex-direction: column; }
    .review-admin-actions { margin-left: 0; margin-top: 15px; }
}

/* Blog Page */
.blog { padding: var(--spacing-xl) 0; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.blog-card { background: var(--white); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: 0.3s; }
.blog-card.featured { grid-column: span 2; flex-direction: row; border: 2px solid var(--accent); }
@media (max-width: 768px) { .blog-card.featured { grid-column: span 1; flex-direction: column; } }

.blog-image { position: relative; aspect-ratio: 16/9; width: 100%; }
.blog-card.featured .blog-image { width: 50%; aspect-ratio: auto; }
.blog-card.no-image .blog-image { display: none; }
.blog-card.no-image.featured { flex-direction: column; }
.blog-card.no-image.featured .blog-content { width: 100%; }
@media (max-width: 768px) { .blog-card.featured .blog-image { width: 100%; aspect-ratio: 16/9; } }
.blog-image img { width: 100%; height: 100%; object-fit: cover; }

.blog-content { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card.featured .blog-content { width: 50%; }
@media (max-width: 768px) { .blog-card.featured .blog-content { width: 100%; } }

.blog-date { font-size: 0.8rem; color: #64748b; margin-bottom: 10px; display: block; }
.blog-content h3 { margin-bottom: 10px; color: var(--primary); }
.blog-excerpt { margin-bottom: 20px; flex: 1; color: var(--text); }

.blog-interactions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding-top: 15px; 
    border-top: 1px solid #f1f5f9; 
    margin-top: auto;
}
.reactions { display: flex; gap: 8px; }
.reaction-btn { 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    padding: 6px 12px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-size: 0.9rem; 
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
}
.reaction-btn:hover { background: #fff; border-color: var(--accent); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.reaction-btn.active { background: #fef3c7; border-color: var(--accent); color: #92400e; }

.btn-comment { 
    background: #f1f5f9; 
    border: none; 
    cursor: pointer; 
    font-size: 0.9rem; 
    color: var(--primary); 
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    transition: 0.2s;
}
.btn-comment:hover { background: var(--primary); color: var(--white); }

/* Inline Comments Section Styling */
.inline-comments-section {
    background: #fdfdfd;
    border-top: 1px solid #f1f5f9;
    padding: 15px; /* Reduced from 30px to increase width */
    animation: slideDown 0.3s ease-out;
    margin-top: 15px;
    border-radius: 0 0 12px 12px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.comment-item {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comment-body {
    flex-grow: 1;
    background: #fffcf0; /* Admin-style gold background */
    padding: 12px 16px;
    border-radius: 0 16px 16px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    border-left: 4px solid var(--accent); /* Admin-style accent border */
}

[dir="rtl"] .comment-body {
    border-radius: 16px 0 16px 16px;
    border-left: 1px solid #f1f5f9;
    border-right: 4px solid var(--accent);
}

.admin-badge, .visitor-badge {
    background: var(--accent);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

[dir="rtl"] .admin-badge, [dir="rtl"] .visitor-badge {
    margin-left: 0;
    margin-right: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.comment-author {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.comment-text {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

.comment-form.modern {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-form.modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.comment-form-main {
    flex-grow: 1;
    width: 100%;
}

.comment-form-main .form-control {
    border: 1px solid transparent !important;
    background: #f1f5f9 !important;
    margin-bottom: 12px !important;
    padding: 14px 18px !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease;
    width: 100%;
    border-radius: 12px !important;
}

.comment-form-main .form-control:focus {
    background: var(--white) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1) !important;
    outline: none;
}

.comment-form-main input.form-control {
    height: 45px !important;
    font-weight: 600;
}

.comment-form-main textarea.form-control {
    height: 90px !important;
    min-height: 90px;
    resize: none;
    line-height: 1.5;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.comment-form-actions button {
    border-radius: 12px !important;
    padding: 10px 25px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary), #1e293b) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.comment-form-actions button:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, 0.3);
}

.replies-container {
    margin-left: 50px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

[dir="rtl"] .replies-container {
    margin-left: 0;
    margin-right: 50px;
}

.replies-container::before {
    content: "";
    position: absolute;
    left: -25px;
    top: -15px;
    bottom: 25px;
    width: 2px;
    background: #e2e8f0;
}

[dir="rtl"] .replies-container::before {
    left: auto;
    right: -25px;
}

.comment-item.reply {
    transform: scale(0.95);
    transform-origin: left top;
}

[dir="rtl"] .comment-item.reply {
    transform-origin: right top;
}

.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.btn-reply {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: 0.2s;
}

.btn-reply:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.btn-delete-link {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.reply-form-container {
    margin-left: 50px;
    margin-top: 10px;
}

[dir="rtl"] .reply-form-container {
    margin-left: 0;
    margin-right: 50px;
}

.comment-form.modern.reply {
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    margin-bottom: 15px;
}

/* Contact Page Modernization */
.contact { 
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    z-index: -1;
}

.contact-header { 
    text-align: center; 
    margin-bottom: 70px; 
}

.contact-header h1 { 
    font-size: 3.5rem; 
    color: var(--primary); 
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.contact-header p { 
    font-size: 1.25rem; 
    color: #64748b; 
    max-width: 650px; 
    margin: 0 auto;
    line-height: 1.6;
}

.contact-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 60px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info-card {
    padding: 50px !important;
    background: linear-gradient(145deg, var(--primary) 0%, #1e293b 100%);
    color: var(--white);
    border: none !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.contact-info-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--accent);
    opacity: 0.1;
    border-radius: 50%;
    z-index: -1;
}

.contact-info-card h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--accent);
    font-weight: 800;
}

.contact-method {
    display: flex;
    gap: 25px;
    margin-bottom: 35px;
    align-items: center;
}

.method-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-method:hover .method-icon {
    background: var(--accent);
    color: var(--primary);
    transform: rotate(10deg) scale(1.1);
}

.contact-method label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
    margin-bottom: 8px;
    font-weight: 800;
}

.contact-method p {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.contact-form-container {
    padding: 60px !important;
    background: var(--white);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
}

.contact-form.modern .form-group {
    margin-bottom: 25px;
}

.contact-form.modern .form-control {
    width: 100%;
    padding: 18px 25px;
    border-radius: 16px;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    font-family: inherit;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-form.modern .form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.1), 0 4px 6px -2px rgba(245, 158, 11, 0.05);
    transform: translateY(-2px);
}

.contact-form.modern textarea.form-control {
    min-height: 180px;
}

.contact-form.modern button {
    width: 100%;
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-form.modern button:hover {
    background: #1e293b;
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
    .contact-grid { padding: 0 20px; }
}

@media (max-width: 992px) {
    .contact-grid { 
        grid-template-columns: 1fr; 
        gap: 40px;
    }
    .contact-info-card { order: 2; }
    .contact-form-container { order: 1; }
}

@media (max-width: 768px) {
    .contact { padding: 60px 0; }
    .contact-header h1 { font-size: 2.5rem; }
    .contact-info-card, .contact-form-container { padding: 35px !important; }
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--white);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-btn.whatsapp {
    background: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.social-btn.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}

.social-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
    color: var(--white);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.admin-social-edit span {
    color: var(--accent);
    font-weight: 700;
    cursor: text;
}

#blog-modal .comments-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
}

#blog-modal .comments-list::-webkit-scrollbar {
    width: 6px;
}

#blog-modal .comments-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

#blog-modal .comments-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.blog-modal-header { margin-bottom: 20px; }
.blog-modal-header h2 { color: var(--primary); margin-top: 5px; }
/* Footer */
footer {
    background: linear-gradient(145deg, var(--primary) 0%, #1e293b 100%) !important;
    color: var(--white);
    padding: 80px 0 30px;
    position: relative;
}

footer::before {

    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: var(--accent);
    opacity: 0.03;
    border-radius: 50%;
    z-index: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.footer-brand .logo {
    color: var(--accent);
    margin-bottom: 20px;
}

.footer-contact h4, .footer-social h4 {
    margin-bottom: 25px;
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-contact-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

.footer-contact-item:hover {
    transform: translateX(8px);
}

[dir="rtl"] .footer-contact-item:hover {
    transform: translateX(-8px);
}

.footer-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.footer-contact-item:hover .footer-icon {
    background: var(--accent);
    color: var(--primary);
    transform: rotate(10deg) scale(1.1);
    border-color: var(--accent);
}

.contact-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.contact-text a {
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: var(--accent);
}

.footer-social-btns {
    flex-direction: column;
    max-width: 220px;
    gap: 12px;
}

.footer-social-btns .social-btn {
    text-align: left;
    padding: 10px 20px;
    font-size: 0.85rem;
}

[dir="rtl"] .footer-social-btns .social-btn {
    text-align: right;
}

.footer-bottom {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.5;
    font-weight: 500;
}

@media (max-width: 768px) {
    .footer-grid { 
        text-align: center; 
        gap: 3.5rem; /* More space between sections */
        padding: 40px 0;
    }

    .footer-brand, .footer-contact, .footer-social {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-contact-item { 
        flex-direction: column;
        gap: 12px;
        margin-bottom: 30px;
        width: 100%;
    }

    .footer-icon {
        width: 55px; /* Larger, more touch-friendly icons */
        height: 55px;
        margin: 0 auto 5px;
    }

    .footer-contact h4, .footer-social h4 {
        margin-bottom: 35px;
        font-size: 1.3rem;
    }

    .contact-text {
        font-size: 1.1rem; /* Easier to read */
        line-height: 1.5;
        max-width: 280px;
    }

    .footer-social-btns { 
        margin: 0 auto; 
        width: 100%;
        max-width: 280px;
    }

    .social-btn {
        padding: 15px 25px;
        font-size: 1rem;
        border-radius: 12px;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Image Sizes */
.img-size-small { width: 25% !important; height: auto; margin-left: auto; margin-right: auto; display: block; }
.img-size-medium { width: 50% !important; height: auto; margin-left: auto; margin-right: auto; display: block; }
.img-size-large { width: 75% !important; height: auto; margin-left: auto; margin-right: auto; display: block; }
.img-size-full { width: 100% !important; height: auto; display: block; }

/* Aspect Ratios & Fit */
.aspect-square { aspect-ratio: 1 / 1 !important; }
.aspect-video { aspect-ratio: 16 / 9 !important; }
.aspect-photo { aspect-ratio: 4 / 3 !important; }
.aspect-auto { aspect-ratio: auto !important; }

.fit-cover { object-fit: cover !important; }
.fit-contain { object-fit: contain !important; }
.fit-fill { object-fit: fill !important; }

/* Border Radius */
.rounded-none { border-radius: 0 !important; }
.rounded-sm { border-radius: 8px !important; }
.rounded-lg { border-radius: 20px !important; }
.rounded-full { border-radius: 50% !important; }

/* Layout Swapping */
.grid-reverse { direction: rtl; }
.grid-reverse > * { direction: ltr; } /* Reset text direction inside */

/* Re-ordering Buttons */
.order-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}
[dir="rtl"] .order-controls { right: auto; left: 10px; }

.btn-order {
    padding: 4px 8px;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.btn-order:hover { background: var(--accent); color: var(--primary); }

.btn-home-toggle {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.5;
}
.btn-home-toggle.active {
    opacity: 1;
    background: var(--accent);
    color: var(--primary);
}
.btn-home-toggle:hover {
    transform: scale(1.1);
}

.line-number-edit {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    background: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid var(--accent);
}
.line-number-edit span {
    min-width: 20px;
    text-align: center;
    outline: none;
    cursor: text;
    display: inline-block;
    color: var(--accent);
}
.line-number-edit:hover {
    background: var(--accent);
    color: var(--primary);
}
.line-number-edit:hover span {
    color: var(--primary);
}

/* Size Selector in Media Controls */
.size-selector {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    background: #fff;
    margin-top: 5px;
    cursor: pointer;
    width: 90%;
}

.dynamic-section, .card, .review-item, .blog-card {
    position: relative;
}

.layout-row { display: grid; gap: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
.row-cols-1 { grid-template-columns: 1fr; }
.row-cols-2 { grid-template-columns: repeat(2, 1fr); }
.row-cols-3 { grid-template-columns: repeat(3, 1fr); }
.row-cols-4 { grid-template-columns: repeat(4, 1fr); }
.row-cols-5 { grid-template-columns: repeat(5, 1fr); }
.row-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Layout Manager Styling */
.layout-manager {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px dashed #cbd5e1;
}
.layout-row-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.layout-row-item input {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

@media (max-width: 768px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-lg: 1.5rem;
    }

    /* Modern Floating Mobile Header */
    .navbar {
        padding: 0.6rem 0;
        position: sticky !important;
        top: 15px;
        width: 94%;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 20px;
        border: none;
        box-shadow: none;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .navbar .container { 
        padding: 0 15px;
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
    }

    .site-logo-img {
        height: 50px; /* Much smaller on mobile for better UX */
    }

    .menu-toggle { 
        display: flex;
        align-items: center;
        justify-content: center;
        width: 45px;
        height: 45px;
        background: var(--primary);
        border-radius: 12px;
        font-size: 1.2rem;
        order: 1; /* Move to the right */
    }

    .actions {
        order: 0;
    }

    .lang-switch {
        padding: 8px 12px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    /* Elegant Full-Screen Side Menu */
    .navbar nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%; /* Full width on mobile */
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        padding: 100px 40px;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    [dir="rtl"] .navbar nav { 
        left: auto; 
        right: -100%; 
    }

    .navbar.menu-open nav { 
        left: 0; 
    }
    
    [dir="rtl"] .navbar.menu-open nav { 
        right: 0; 
    }

    .navbar nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        width: 100%;
    }

    .navbar nav ul li a {
        background: transparent;
        color: white;
        font-size: 1.5rem;
        font-weight: 700;
        padding: 15px;
        border-radius: 0;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .navbar nav ul li a.active {
        background: transparent;
        color: var(--accent);
    }

    /* Grid Stacking & Spacing */
    .hero-grid, .about-grid, .grid, .reviews-list, .footer-grid, .contact-grid, .layout-row { 
        grid-template-columns: 1fr !important; 
        text-align: center; 
        gap: 2.5rem;
    }

    .hero-text h1 { font-size: 2.2rem; line-height: 1.1; }
    .section-header h1 { font-size: 2.2rem; }
    
    .card { padding: 2rem 1.5rem; border-radius: 20px !important; }
    
    /* Contact Form on Mobile */
    .contact-form-container {
        padding: 30px 20px !important;
    }

    .contact-method {
        flex-direction: column;
        gap: 10px;
    }

    .method-icon {
        margin: 0 auto;
    }
}

/* Services, Blog & Contact Page Transparency */
.services-page section, .blog-page section, .contact-page section {
    background: transparent !important;
}

.services-page .card, .blog-page .card, .contact-page .card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.services-page .card:hover, .blog-page .card:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--accent);
}

/* Disable Hover Effects on Contact Page */
.contact-page .card:hover,
.contact-page .contact-method:hover,
.contact-page .method-icon,
.contact-page .social-btn:hover,
.contact-page .contact-form.modern button:hover {
    transform: none !important;
    background: inherit;
    box-shadow: none !important;
    border-color: inherit;
    opacity: 1 !important;
}

.contact-page .contact-method:hover .method-icon {
    transform: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: inherit !important;
}

.contact-page .card:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.contact-page .contact-info-card:hover {
    background: linear-gradient(145deg, var(--primary) 0%, #1e293b 100%) !important;
}

.contact-page .contact-info-card {
    background: linear-gradient(145deg, var(--primary) 0%, #1e293b 100%) !important;
    color: var(--white);
    border: none !important;
    backdrop-filter: none;
}

.services-page .layout-manager, .blog-page .layout-manager {
    background: rgba(241, 245, 249, 0.6) !important;
    backdrop-filter: blur(5px);
    border: 1px dashed var(--accent);
}

.services-page .layout-row-item {
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Homepage Transparency */
.home-page section,
.home-page .card,
.home-page .blog-card,
.home-page .review-item,
.home-page .dynamic-section {
    background: transparent !important;
    box-shadow: none !important;
}

.home-page .services-preview,
.home-page .blog-preview,
.home-page .reviews-preview,
.home-page .dynamic-sections,
.home-page .about-preview {
    background: transparent !important;
}

.home-page .card {
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.home-page .card:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: var(--accent);
}

/* Pulse animation for CTA */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(15, 23, 42, 0.4); }
    100% { box-shadow: 0 0 0 15px rgba(15, 23, 42, 0); }
}

.full-width {
    width: 100%;
}

/* Before-After Slider */
.before-after-container {
    position: relative;
    width: 100%;
    max-width: 850px; /* Slightly wider */
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--spacing-sm);
    background: transparent;
    touch-action: pan-y;
    /* Height will be determined by the before-image */
}

/* Typography Enhancements */
h1, h2, h3, .modern-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-header h1 {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--primary) 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 500;
}

.before-after-label {
    position: absolute;
    bottom: 24px;
    padding: 6px 18px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px); /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.7rem; /* Slightly smaller as requested */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em; /* More attractive spacing */
    border-radius: 50px; /* Fully curved pill shape */
    pointer-events: none;
    z-index: 15;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.label-before {
    left: 24px;
}

.label-after {
    right: 24px;
}

/* Design Studio Header Enhancements */
.modern-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modern-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}

.before-after-container .overlay-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
    /* Reveal background (Before) from left to right as inset-left increases */
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0.1s ease-out;
}

.before-after-container .background-image {
    position: relative; 
    width: 100%;
    z-index: 1;
    display: block;
    filter: grayscale(100%) contrast(1.1); 
}

.before-after-container.no-grayscale .background-image,
.gallery-item.no-grayscale .background-image,
.no-grayscale .background-image {
    filter: none !important;
}

/* Ensure images inside slider behave correctly */
.before-after-container img, 
.before-after-container video,
.before-after-container .editable-media-wrapper,
.before-after-container .editable-media {
    width: 100% !important;
    height: auto !important; 
    display: block !important;
    max-width: none !important;
    margin: 0 !important;
}

.before-after-container .overlay-image img,
.before-after-container .overlay-image video,
.before-after-container .overlay-image .editable-media-wrapper,
.before-after-container .overlay-image .editable-media {
    position: absolute;
    top: 0;
    left: 0;
    height: 100% !important; 
    object-fit: cover !important;
}

.before-after-container .background-image img,
.before-after-container .background-image video,
.before-after-container .background-image .editable-media-wrapper,
.before-after-container .background-image .editable-media {
    position: relative;
}

/* Remove lightbox cursor and pointer events from the images inside the slider */
.before-after-container img {
    pointer-events: none;
    cursor: default;
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px; /* Straight 2px minimalist line */
    background: black;
    z-index: 10;
    pointer-events: none;
    transform: translateX(-50%);
    transition: left 0.1s ease-out;
}

.slider-handle::after {
    content: "↔";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: white;
    border: 3px solid black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-size: 1.3rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.before-after-container:hover .slider-handle::after {
    transform: translate(-50%, -50%) scale(1.1);
    background: black;
    color: white;
}

.before-after-container .slider-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 20;
    cursor: ew-resize;
    margin: 0;
}

/* RTL Support */
html[lang="ar"] .slider-handle::after {
    content: "↔";
}
