/* 2026 stability, accessibility and responsive polish layer */
:root {
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --ink: #17212f;
    --muted-ink: #5d6674;
    --line: rgba(23, 33, 47, 0.12);
    --focus-ring: 0 0 0 4px rgba(219, 179, 101, 0.28);
}

html {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(219, 179, 101, 0.13), transparent 34rem),
        linear-gradient(180deg, #f7f9fc 0%, #ffffff 46%, #f3f6fa 100%);
}

a,
button,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.modern-header {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.modern-logo,
.nav-link,
.contact-item,
.hero-btn,
.service-btn,
.cta-btn,
.floating-btn,
.quick-search-btn,
.search-btn {
    touch-action: manipulation;
}

.hero-section {
    isolation: isolate;
}

.hero-slide {
    background-position: center;
    background-size: cover;
}

.hero-content {
    width: min(92vw, 920px);
}

.hero-title,
.section-title,
.service-title,
.news-title {
    letter-spacing: 0;
    text-wrap: balance;
}

.hero-subtitle,
.hero-description,
.section-description,
.service-description,
.news-excerpt {
    text-wrap: pretty;
}

.hero-buttons,
.service-actions,
.cta-buttons,
.result-actions {
    gap: 12px;
}

.service-card,
.mission-card,
.vision-card,
.news-card,
.trust-badge,
.info-card,
.search-form-container,
.quick-search-container {
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(23, 33, 47, 0.08);
}

.service-card,
.news-card,
.team-member,
.trust-badge {
    height: 100%;
}

.service-card:hover,
.news-card:hover,
.trust-badge:hover {
    transform: translateY(-6px);
}

.search-input,
.quick-search-input {
    min-height: 48px;
    color: var(--ink);
}

.search-input::placeholder,
.quick-search-input::placeholder {
    color: var(--muted-ink);
    opacity: 0.85;
}

.search-results-container,
.quick-search-results {
    overflow-wrap: anywhere;
}

.client-info,
.search-result-item {
    contain: content;
}

.floating-actions {
    inset-inline-end: max(16px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
}

.floating-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

img {
    content-visibility: auto;
}

@media (max-width: 991.98px) {
    .modern-header {
        position: sticky;
        top: 0;
    }

    .header-contact {
        display: none;
    }

    .hero-content {
        padding-inline: 18px;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
        line-height: 1.18;
    }

    .hero-subtitle {
        font-size: clamp(1rem, 4.6vw, 1.35rem);
    }

    .hero-description {
        font-size: 0.98rem;
    }

    .hero-buttons,
    .cta-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-btn,
    .cta-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .quick-search-widget {
        inset-inline: 10px;
        width: auto;
        max-width: none;
    }

    .floating-actions {
        gap: 10px;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
    }

    .section-header {
        padding-inline: 12px;
    }

    .search-form-container,
    .service-card,
    .news-card {
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    #particles-canvas,
    .floating-elements {
        display: none !important;
    }
}

@media print {
    .quick-search-widget,
    .floating-actions,
    .scroll-progress,
    .loading-overlay,
    #particles-canvas {
        display: none !important;
    }
}

/* Professional transaction result action center */
.result-command-center {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid rgba(219, 179, 101, 0.38);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
        radial-gradient(circle at top right, rgba(219, 179, 101, 0.18), transparent 20rem);
    box-shadow: 0 18px 42px rgba(23, 33, 47, 0.10);
}

.command-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    color: var(--ink);
}

.command-copy strong {
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.5;
}

.command-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(219, 179, 101, 0.14);
    color: #8b6420;
    font-weight: 800;
    font-size: 0.86rem;
}

.result-command-center .info-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
}

.result-command-center .action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 76px;
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(23, 33, 47, 0.10);
    border-radius: 14px;
    background: var(--surface-strong);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(23, 33, 47, 0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.result-command-center .action-btn::after {
    content: "";
    position: absolute;
    inset: auto 14px 10px 14px;
    height: 3px;
    border-radius: 999px;
    background: rgba(219, 179, 101, 0.42);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.22s ease;
}

.result-command-center .action-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(219, 179, 101, 0.55);
    box-shadow: 0 18px 34px rgba(23, 33, 47, 0.13);
}

.result-command-center .action-btn:hover::after {
    transform: scaleX(1);
}

.result-command-center .action-primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, #1f5f8f 0%, #23364d 56%, #dbb365 150%);
}

.result-command-center .action-primary .action-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.result-command-center .action-primary .action-text small {
    color: rgba(255, 255, 255, 0.78);
}

.result-command-center .whatsapp-btn {
    border-color: rgba(37, 211, 102, 0.28);
}

.result-command-center .whatsapp-btn .action-icon {
    color: #128c4c;
    background: rgba(37, 211, 102, 0.12);
}

.result-command-center .contact-btn .action-icon {
    color: #0b7285;
    background: rgba(11, 114, 133, 0.10);
}

.result-command-center .copy-btn .action-icon,
.result-command-center .share-btn .action-icon {
    color: #7b5b19;
    background: rgba(219, 179, 101, 0.16);
}

.result-command-center .print-btn .action-icon,
.result-command-center .print-visa-btn .action-icon {
    color: #334155;
    background: rgba(51, 65, 85, 0.10);
}

.result-command-center .search-again-btn .action-icon {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.10);
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.action-text {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: start;
}

.action-text strong {
    font-size: 0.98rem;
    line-height: 1.35;
    white-space: nowrap;
}

.action-text small {
    color: var(--muted-ink);
    font-size: 0.78rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-command-center .action-btn.disabled,
.result-command-center .action-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.45);
    opacity: 0.58;
    transform: none !important;
}

.result-toast {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 13px 16px;
    border-radius: 12px;
    color: #ffffff;
    background: #23364d;
    box-shadow: 0 18px 38px rgba(23, 33, 47, 0.24);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.result-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.result-toast.success {
    background: #147d52;
}

.result-toast.warning {
    background: #9a6700;
}

.result-toast.error {
    background: #b42318;
}

@media (max-width: 1199.98px) {
    .result-command-center .info-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .command-copy {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-command-center {
        padding: 14px;
        border-radius: 14px;
    }

    .result-command-center .info-actions {
        grid-template-columns: 1fr;
    }

    .result-command-center .action-btn {
        min-height: 68px;
    }

    .result-toast {
        right: 12px;
        left: 12px;
        bottom: 14px;
        max-width: none;
    }
}

/* Database error contact actions must remain clickable above decorative layers */
.error-message::before {
    pointer-events: none !important;
}

.error-message .error-icon,
.error-message .error-text,
.error-message .error-subtext,
.error-message .error-details,
.error-message .error-contact {
    position: relative;
    z-index: 5;
}

.error-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    pointer-events: auto !important;
}

.error-btn {
    position: relative;
    z-index: 6;
    pointer-events: auto !important;
    cursor: pointer;
    min-width: 138px;
    justify-content: center;
    border: 0;
}

.error-call-btn {
    background: linear-gradient(135deg, #dc3545 0%, #b42335 100%) !important;
}

.error-whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c4c 100%) !important;
    margin-left: 0 !important;
}

.error-btn:hover {
    color: #fff !important;
}

/* Local social icon rendering */
.footer-social .social-link {
    position: relative;
    color: #fff !important;
    font-size: 0;
}

.footer-social .social-link i,
.footer-contact i.bi,
.contact-icon i.bi,
.floating-btn i.bi,
.hero-btn i.bi,
.cta-btn i.bi,
.footer-links i.bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    line-height: 1;
    text-transform: none;
    speak: never;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.footer-social .social-link i {
    position: relative;
    z-index: 2;
    font-size: 21px;
}

.footer-social .social-link .social-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.7);
}

.footer-social .social-link i + .social-fallback {
    opacity: 0;
}

.footer-contact i.bi {
    font-size: 18px;
}

.contact-icon i.bi {
    font-size: 15px;
    color: inherit;
}

.hero-btn i.bi,
.cta-btn i.bi,
.footer-links i.bi {
    font-size: 1em;
    color: currentColor;
}

.floating-btn {
    position: relative;
    font-size: 0;
    color: #fff !important;
}

.floating-btn i.bi {
    position: relative;
    z-index: 2;
    font-size: 24px;
    color: #fff;
}

.floating-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.72);
}

.floating-btn i + .floating-fallback {
    opacity: 0;
}

.footer-social .social-link[aria-label="واتساب"]:hover {
    background: #25d366;
}

.footer-social .social-link[aria-label="اتصال"]:hover {
    background: #0d6efd;
}

.footer-social .social-link[aria-label="إنستغرام"]:hover {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.footer-social .social-link[aria-label="فيسبوك"]:hover {
    background: #1877f2;
}

.footer-social .social-link[aria-label="تيليجرام"]:hover {
    background: #229ed9;
}

.footer-social .social-link[aria-label="تويتر"]:hover {
    background: #1da1f2;
}
