/* ==============================================================
   deyaaeldin.com  —  Main Stylesheet
   ============================================================== */

html { scroll-behavior: smooth; }

/* ----------- Language switching: pure CSS, super fast ----------- */
html[data-lang="ar"] .lang-en,
html[data-lang="ar"] .lang-ur { display: none !important; }

html[data-lang="en"] .lang-ar,
html[data-lang="en"] .lang-ur { display: none !important; }

html[data-lang="ur"] .lang-ar,
html[data-lang="ur"] .lang-en { display: none !important; }

html[data-lang="en"] body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* ----------- Brand colors fallback (in case Tailwind config fails) ----------- */
.text-primary   { color: #1a365d; }
.text-secondary { color: #c59d5f; }
.bg-primary     { background-color: #1a365d; }
.bg-secondary   { background-color: #c59d5f; }
.border-primary { border-color: #1a365d; }
.hover\:text-secondary:hover { color: #c59d5f; }
.hover\:bg-primary:hover { background-color: #1a365d; }

/* ----------- Navigation ----------- */
.nav-link {
    color: #1a365d;
    font-weight: 500;
    padding: 6px 4px;
    transition: color .2s, border-color .2s;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: #c59d5f; }
.active-nav {
    color: #c59d5f !important;
    border-bottom-color: #c59d5f;
}

/* ----------- Animations ----------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn .6s ease-out both; }
.animate-fade-in.delay-100 { animation-delay: .1s; }
.animate-fade-in.delay-200 { animation-delay: .2s; }
.animate-fade-in.delay-300 { animation-delay: .3s; }

/* ----------- Scroll-triggered animations ----------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.animate-on-scroll {
    opacity: 0;
    transition: opacity .1s;
}
.animate-on-scroll.animated {
    animation-duration: .7s;
    animation-fill-mode: both;
    animation-timing-function: ease-out;
}
.animate-on-scroll.animated.anim-fade-up    { animation-name: fadeInUp; }
.animate-on-scroll.animated.anim-fade-left  { animation-name: fadeInLeft; }
.animate-on-scroll.animated.anim-fade-right { animation-name: fadeInRight; }
.animate-on-scroll.animated.anim-scale      { animation-name: scaleIn; }
.animate-on-scroll.animated:not(.anim-fade-up):not(.anim-fade-left):not(.anim-fade-right):not(.anim-scale) {
    animation-name: fadeInUp;
}

.anim-delay-1 { animation-delay: .1s !important; }
.anim-delay-2 { animation-delay: .2s !important; }
.anim-delay-3 { animation-delay: .3s !important; }
.anim-delay-4 { animation-delay: .4s !important; }
.anim-delay-5 { animation-delay: .5s !important; }

/* ----------- Service card hover ----------- */
.service-card { transition: transform .3s, box-shadow .3s; }
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
}

/* ----------- Library cards ----------- */
.file-card { transition: all .25s ease; }
.file-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
}
.file-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem;
}
.file-icon-pdf  { background: #dc2626; }
.file-icon-doc  { background: #2563eb; }
.file-icon-xls  { background: #16a34a; }
.file-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: .7rem;
    border-radius: 999px;
    font-weight: 700;
    margin-top: 4px;
}
.file-badge-pdf { background: #fee2e2; color: #dc2626; }
.file-badge-doc { background: #dbeafe; color: #2563eb; }
.file-badge-xls { background: #dcfce7; color: #16a34a; }

/* ----------- Modal ----------- */
.modal { position: fixed; inset: 0; display: none; z-index: 1000; }
.modal:not(.hidden) { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal-dialog {
    position: relative; max-width: 860px; margin: 6vh auto;
    background: #fff; border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    padding: 16px; overflow: auto; max-height: 88vh;
}
.modal-close {
    position: absolute; top: 8px; inset-inline-end: 8px;
    font-size: 28px; line-height: 1; border: none;
    background: transparent; cursor: pointer;
}
.modal-hero {
    height: 320px; background: #1a365d;
    display: flex; align-items: center; justify-content: center;
    color: #fff; border-radius: 10px; overflow: hidden;
}
.modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-title { font-weight: 800; color: #1f2937; margin: 12px 0 4px; font-size: 26px; }
.modal-badge { color: #6b7280; display: flex; gap: .4rem; align-items: center; margin: .3rem 0 .6rem 0; }
.modal-content { color: #374151; line-height: 1.9; white-space: pre-wrap; }

/* ----------- Text section toggle ----------- */
.text-section .text-wrapper {
    max-height: 120px;
    overflow: hidden;
    position: relative;
    transition: max-height .5s ease;
}
.text-section .text-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    transition: opacity .3s;
}
.text-section .text-wrapper.expanded {
    max-height: 3000px;
}
.text-section .text-wrapper.expanded::after {
    opacity: 0;
}
/* For service cards inside gray bg */
.bg-gray-50 .text-section .text-wrapper::after {
    background: linear-gradient(transparent, #fff);
}

.toggle-button {
    display: inline-block;
    margin-top: 8px;
    color: #c59d5f;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 0;
    font-size: .9rem;
    transition: color .2s;
}
.toggle-button:hover { color: #1a365d; text-decoration: underline; }

/* ----------- Language buttons ----------- */
.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background .2s;
}
.lang-btn:hover { background: #f3f4f6; }

/* ----------- Helpers ----------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ----------- Order service button pulse ----------- */
.order-service-btn {
    position: relative;
    overflow: hidden;
}
.order-service-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.2);
    transform: translateX(-100%);
    transition: transform .4s;
}
.order-service-btn:hover::after {
    transform: translateX(100%);
}

/* ----------- Print ----------- */
@media print {
    header, footer { display: none !important; }
}

/* ----------- Mobile nav smooth open/close animation ----------- */
/* On mobile only: override Tailwind's `hidden` (display:none) with max-height animation.
   The ID selector has higher specificity than .hidden so it wins.
   On md+ screens, Tailwind's md:hidden media-query still hides the nav as expected. */
@media (max-width: 767px) {
    #mobile-nav {
        display: block !important;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.25s ease;
    }
    #mobile-nav.mobile-open {
        max-height: 400px;
        opacity: 1;
    }
}
