@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Inter:wght@400;600;700&display=swap');

:root {
    --main-border-radius: 16px;
    --main-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --primary-color: #f36805;
    --hover-color: #d95a04;
    --brand-orange: #f36805;
    --brand-orange-hover: #cc4f00;
    
    --bg-color: #f6f3ef;
    --text-color: #242e30;
    --container-bg: rgba(255, 255, 255, 0.75);
    --container-border: rgba(231, 226, 218, 0.9);
    --footer-bg: #242e30;
    --footer-text: #fff;
    --job-bg: #f36805;
}

body.dark-mode {
    --bg-color: #2b2a28;
    --text-color: #f0ece6;
    --container-bg: rgba(43, 42, 40, 0.82);
    --container-border: rgba(255, 255, 255, 0.1);
    --main-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --footer-bg: #2b2a28;
    --footer-text: #ddd;
    --job-bg: #cc4f00;
    --brand-orange: #f36805; /* aligned with reference palette */
}

body {
    font-family: 'Inter', 'Cairo', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    background: #000;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    z-index: 2000;
    transition: top 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 12px;
}

[dir="rtl"] .skip-link {
    left: auto;
    right: 12px;
}

/* Layout-Container */
.container {
    width: 85%;
    max-width: 1000px;
    margin: auto;
    overflow: hidden;
    position: relative;
}

@media screen and (max-width: 768px) {
    .container {
        width: 92%;
    }
}

/* Header */
header {
    background: var(--brand-orange);
    color: #fff;
    padding: 18px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(243, 104, 5, 0.3);
    position: relative;
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

/* Premium Dark Mode Toggle */
.dark-mode-toggle {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1) rotate(15deg);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.dark-mode-toggle i {
    transition: transform 0.4s ease;
}
.dark-mode-toggle .theme-icon-sun {
    color: #ffd700;
}


body.dark-mode .dark-mode-toggle {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

@media screen and (max-width: 768px) {
    .dark-mode-toggle {
        top: 15px;
        left: 15px;
        transform: none;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .dark-mode-toggle:hover {
        transform: scale(1.05) rotate(15deg);
    }
}

/* Navigation Language Button */
.arabic-button {
    background-color: rgba(0,0,0,0.3);
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.arabic-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.05);
}

@media (max-width: 768px) {
    .arabic-button {
        top: 10px;
        right: 10px;
        transform: none;
        font-size: 14px;
        padding: 8px 16px;
    }
    .arabic-button:hover {
        transform: scale(1.05);
    }
    header h1 {
        font-size: 22px;
        margin-top: 35px;
    }
}

/* Bild: Profil */
.profile-image-container {
    text-align: center;
    margin: 40px 0;
}

/* Responsive Profilbild */
.profile-image {
    max-width: 190px;
    width: 100%;
    height: auto;
    border-radius: 50%;
    border: 4px solid var(--brand-orange);
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
}

section {
    text-align: center;
    padding: 25px;
    background-color: var(--container-bg);
    border: 1px solid var(--container-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--main-border-radius);
    box-shadow: var(--main-box-shadow);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

body.dark-mode section:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

section p {
    text-align: start;
    line-height: 1.7;
    margin-bottom: 18px;
    font-size: 0.98rem;
    color: var(--text-color);
    opacity: 0.9;
}

@media screen and (max-width: 768px) {
    section p {
        text-align: start;
        word-spacing: normal;
    }
}

section h2 {
    font-size: 24px;
    color: var(--brand-orange);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid rgba(243, 104, 5, 0.4);
    display: inline-block;
    padding-bottom: 6px;
    margin-bottom: 20px;
    margin-top: 0;
}

section h3 {
    text-align: left;
    font-size: 20px;
    color: var(--text-color);
    border-left: 5px solid var(--brand-orange);
    padding-left: 12px;
    margin-top: 30px;
    margin-bottom: 15px;
}

[dir="rtl"] section h3 {
    text-align: right;
    border-left: none;
    border-right: 5px solid var(--brand-orange);
    padding-left: 0;
    padding-right: 12px;
}

/* Introduction Drop Cap */
.intro-text::first-letter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--brand-orange);
    float: left;
    line-height: 0.8;
    margin-right: 10px;
    margin-top: 6px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

[dir="rtl"] .intro-text::first-letter {
    float: right;
    margin-right: 0;
    margin-left: 10px;
}

/* Beautiful Lists (Chips/Cards for streets) */
.street-list {
    list-style-type: none;
    padding: 0;
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.street-list li {
    background-color: rgba(243, 104, 5, 0.08);
    border: 1px solid rgba(243, 104, 5, 0.2);
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.street-list li:hover {
    background-color: var(--brand-orange);
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(243, 104, 5, 0.3);
    border-color: var(--brand-orange);
}

.noscript-banner {
    background-color: var(--brand-orange);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-weight: 700;
}

.map-image-fluid {
    width: 100%;
    height: auto;
}

.inline-center-block {
    text-align: center;
    margin: 30px 0;
}

.reset-link-button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    outline: none !important;
    display: inline-flex !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Professional Footer Grid */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 40px 0;
    margin-top: 60px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    transition: background-color 0.4s ease, color 0.4s ease;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media screen and (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .footer-about h3::after, .footer-tech h3::after { left: 50% !important; right: auto !important; transform: translateX(-50%) !important; width: 80% !important; }
    .social-links { justify-content: center; }
}

.footer-about { text-align: left; }
.footer-links { text-align: center; display: flex; flex-direction: column; align-items: center; }


[dir="rtl"] .footer-about { text-align: right; }
[dir="rtl"] 

[dir="rtl"] .footer-grid {
    text-align: right;
}

.footer-grid h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    margin-top: 0;
}

.footer-grid h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
}

[dir="rtl"] .footer-grid h3::after {
    left: auto;
    right: 0;
}
.footer-about h3::after { left: 0; width: 60%; }
[dir="rtl"] .footer-about h3::after { left: auto; right: 0; width: 60%; }
.footer-links h3::after { left: 50%; transform: translateX(-50%); width: 80%; }
.footer-tech h3::after { right: 0; width: 60%; }
[dir="rtl"] .footer-tech h3::after { left: 0; right: auto; width: 60%; }

.footer-about p, .footer-tech p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 15px;
    color: #fff;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #fff;
    opacity: 0.85;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 15px;
    border-radius: 6px;
    width: fit-content;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links a:hover {
    background: #fff;
    color: var(--footer-bg);
    opacity: 1;
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

[dir="rtl"] .footer-links a:hover {
    transform: translateY(-3px);
}

.tech-logo {
    transition: transform 0.3s;
    
}
.tech-logo:hover {
    transform: translateY(-5px);
}

.social-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.social-links a {
    display: inline-block;
    padding: 10px 22px;
    background-color: #fff;
    color: #000000;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.social-links a:hover {
    background-color: #f8f9fa;
    color: #000000;
    transform: translateY(-3px);
}

/* Karte (Bild statt iframe) */
.map-container {
    position: relative;
    width: 100%;
    margin-top: 20px;
    border-radius: var(--main-border-radius);
    overflow: hidden;
    box-shadow: var(--main-box-shadow);
    background: var(--container-bg);
}

.map-link-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--main-border-radius);
}

.map-link-wrapper::after {
    content: "📍 Google Maps";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(3px);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 2;
}

[dir="rtl"] .map-link-wrapper::after {
    content: "📍 افتح في خرائط جوجل";
}

.map-link-wrapper:hover::after {
    opacity: 1;
}

.map-link-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-link-wrapper:hover img {
    transform: scale(1.05);
}

/* Job-Anzeige (Lieferando) */
.job-ad {
    background-color: var(--job-bg);
    color: white;
    padding: 30px;
    border-radius: var(--main-border-radius);
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.2);
    transition: transform 0.3s ease, background-color 0.4s ease;
}

.job-ad:hover {
    transform: translateY(-5px);
}

.job-ad h2 {
    font-size: 26px;
    margin-bottom: 15px;
    margin-top: 0;
}

.job-ad p {
    font-size: 18px;
    margin-bottom: 20px;
}

.job-ad a {
    background-color: white;
    color: var(--job-bg);
    padding: 12px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.job-ad a:hover {
    background-color: var(--hover-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Kontakt-Sektion mit Overlay-Text */
.kontakt-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.kontakt-image {
    width: 100%;
    height: auto;
    min-height: 280px;
    display: block;
    border-radius: var(--main-border-radius);
    object-fit: cover;
    filter: contrast(1.1);
    transition: transform 0.8s ease;
}

.kontakt-container:hover .kontakt-image {
    transform: scale(1.03);
}

.kontakt-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 15px 25px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 12px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.kontakt-text p {
    color: white;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 5px 0;
    opacity: 1;
}

.kontakt-container:hover .kontakt-text {
    background: rgba(0, 0, 0, 0.85);
    transform: translateX(-50%) translateY(-5px);
}

.kontakt-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.kontakt-text a:hover {
    color: var(--brand-orange);
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .kontakt-text {
        position: relative;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0 0 var(--main-border-radius) var(--main-border-radius);
        font-size: 0.95rem;
        padding: 15px;
    }
    
    .kontakt-container:hover .kontakt-text {
        transform: none;
    }

    .kontakt-image {
        border-radius: var(--main-border-radius) var(--main-border-radius) 0 0;
        min-height: auto;
    }
}

/* Buttons: Datenschutz & Impressum */
.privacy-button,
.login-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--brand-orange);
    background-color: transparent;
    color: var(--brand-orange);
    transition: all 0.3s ease;
}

.privacy-button:hover,
.login-button:hover {
    background-color: var(--brand-orange);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(243, 104, 5, 0.3);
}

body.dark-mode .privacy-button,
body.dark-mode .login-button {
    color: #fff;
    border-color: var(--brand-orange);
    background-color: rgba(243, 104, 5, 0.1);
}

body.dark-mode .privacy-button:hover,
body.dark-mode .login-button:hover {
    background-color: var(--brand-orange);
    box-shadow: 0 5px 15px rgba(243, 104, 5, 0.5);
}

/* Allgemeine Bild-Klasse */
.img-fluid {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* Simple utility class */
.mb-2 {
    margin-bottom: 1.5rem;
}

/* =========================================================================
   CROSS-DEVICE & CROSS-BROWSER COMPATIBILITY SUITE
   - Added for TV/Tablet/Small Mobile support
   - Universal Fallbacks included
   ========================================================================= */

/* Safe Fallbacks for very old browsers (IE11/Safari 9 Polyfills) */
header {
    background-color: #f36805; /* Raw HEX Fallback before variable processing */
    background-color: var(--brand-orange);
}

.arabic-button {
    -webkit-backdrop-filter: blur(5px);
}
section {
    -webkit-backdrop-filter: blur(10px);
}
.kontakt-text {
    -webkit-backdrop-filter: blur(8px);
}
.map-link-wrapper::after {
    -webkit-backdrop-filter: blur(3px);
}
.holiday-greeting-card {
    -webkit-backdrop-filter: blur(10px);
}

/* Fallbacks for grids and flexboxes without gap support */
@supports not (gap: 12px) {
    .social-links a, .footer-links a {
        margin: 6px;
    }
}

/* ================= LARGE SCREENS (TVs / Ultra-Wide monitors / 4K) ================= */
@media screen and (min-width: 1440px) {
    body { font-size: 1.15rem; }
    .container { max-width: 1200px; width: 80%; }
    header { padding: 35px 0; }
    header h1 { font-size: 34px; margin-top: 10px; }
    .profile-image { max-width: 250px; border-width: 5px; }
    section { padding: 40px; margin-bottom: 45px; }
    section h2 { font-size: 30px; padding-bottom: 12px; }
    .intro-text::first-letter { font-size: 4.5rem; margin-top: 12px; }
    .street-list li { font-size: 1.1rem; padding: 15px 25px; }
    .job-ad { padding: 50px; }
    .job-ad h2 { font-size: 32px; }
    .job-ad p { font-size: 20px; }
    footer { padding: 60px 0 50px 0; }
    .footer-grid h3 { font-size: 1.4rem; }
    .footer-about p, .footer-tech p, .footer-links a { font-size: 1.05rem; }
}

@media screen and (min-width: 2000px) {
    body { font-size: 1.35rem; }
    .container { max-width: 1600px; }
    header { padding: 50px 0; }
    header h1 { font-size: 46px; margin-top: 15px; }
    .profile-image { max-width: 330px; border-width: 7px; }
    section { padding: 55px; margin-bottom: 60px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); }
    section h2 { font-size: 40px; padding-bottom: 15px; }
    .intro-text::first-letter { font-size: 5.5rem; margin-top: 16px; }
    .street-list li { font-size: 1.3rem; padding: 20px 32px; }
    .job-ad h2 { font-size: 44px; }
    .job-ad p { font-size: 26px; }
    .job-ad a { padding: 20px 40px; font-size: 1.3rem; }
    .footer-grid h3 { font-size: 1.8rem; }
    .footer-about p, .footer-tech p, .footer-links a { font-size: 1.3rem; }
}

/* ================= EXTREME MOBILES (iPhone SE, Galaxy Fold 1, Old Tiny Phones) ================= */
@media screen and (max-width: 380px) {
    body { font-size: 0.9rem; }
    .container { width: 95%; }
    header h1 { font-size: 1.25rem; margin-top: 40px; }
    .profile-image { max-width: 140px; border-width: 3px; }
    .arabic-button { padding: 6px 14px; font-size: 0.85rem; top: 10px; right: 10px; }
    .dark-mode-toggle { width: 34px; height: 34px; font-size: 0.9rem; top: 12px; left: 12px; }
    section { padding: 15px; margin-bottom: 20px; }
    section h2 { font-size: 1.3rem; }
    section h3 { font-size: 1.1rem; }
    .intro-text::first-letter { font-size: 2.3rem; margin-top: 4px; }
    .street-list { gap: 8px; }
    .street-list li { font-size: 0.8rem; padding: 8px 14px; border-radius: 20px; }
    .job-ad { padding: 20px 15px; }
    .job-ad h2 { font-size: 1.4rem; }
    .job-ad p { font-size: 1rem; }
    .job-ad a { padding: 10px 20px; font-size: 0.9rem; }
    .social-links a { padding: 8px 16px; font-size: 0.8rem; }
    .kontakt-text p { font-size: 0.85rem; }
    footer { padding: 30px 0 20px 0; }
    .footer-grid h3 { font-size: 1.1rem; }
    .footer-about p, .footer-tech p, .footer-links a { font-size: 0.85rem; }
    .holiday-greeting-card { font-size: 0.85rem; padding: 4px 10px; margin-top: 8px; }
}

/* Gracefully degrading transforms */
.profile-image:hover, .job-ad:hover, .street-list li:hover {
    -webkit-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
}
/* =========================================================================
   ACCESSIBILITY & KEYBOARD NAVIGATION (a11y)
   ========================================================================= */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
    border-radius: 4px;
    transition: outline 0.1s;
}

/* Ensure body dark mode respects focus visibility cleanly */
body.dark-mode a:focus-visible, body.dark-mode button:focus-visible {
    outline: 3px solid var(--brand-orange);
    box-shadow: 0 0 10px rgba(255, 123, 36, 0.6);
}
/* New Legal Links Formatting */
.footer-legal-links {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-legal-links a {
    color: #fff;
    opacity: 0.7;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.3s ease;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}
.footer-legal-links a:hover {
    opacity: 1;
    color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}
.copyright-text {
    opacity: 0.7 !important;
    font-size: 0.85rem !important;
    margin-top: -10px !important;
    margin-bottom: 20px !important;
}
.tech-logo { background: transparent !important; display: block; margin-top: 15px; }

/* Secure the IVAN tech logo against global anchor outlines */
.footer-tech a, .footer-tech a:hover, .footer-tech a:focus-visible {
    border: none !important;
    outline: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
.tech-logo {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}
/* Fix button clipping in header */
header .container { overflow: visible !important; }

.footer-tech { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
[dir="rtl"] .footer-tech { align-items: flex-end; text-align: left; }

/* Mobile Override Fixes */
@media screen and (max-width: 768px) {
    header {
        padding: 15px 0 !important;
    }
    header h1 {
        margin-top: 50px !important;
        font-size: 22px;
    }
    .dark-mode-toggle {
        top: 12px;
        left: 15px;
    }
    .arabic-button {
        top: 12px;
        right: 15px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 30px !important;
    }
    .footer-about, .footer-tech {
        align-items: center !important;
        text-align: center !important;
    }
    .footer-about h3::after, .footer-tech h3::after {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 80% !important;
    }
    .footer-legal-links {
        justify-content: center;
        margin-top: 20px;
    }
}
@media screen and (max-width: 768px) { header .container { position: static !important; } header { position: relative !important; } .arabic-button { top: 15px !important; right: 15px !important; } .dark-mode-toggle { top: 15px !important; left: 15px !important; } }

/* Extreme Hard Override for IVAN Logo Ghosting/Edge bleeding */
.tech-logo {
    border: 0 !important;
    outline: 0 !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}
.footer-tech a {
    border: none !important;
    border-right: none !important;
    border-bottom: none !important;
    outline: none !important;
    background: transparent !important;
    text-decoration: none !important;
}
/* Browser Graphic Rendering Engine Fixes (Sub-pixel aliasing bug on Drop Shadow) */
.tech-logo {
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    will-change: transform, filter !important;
    padding: 2px !important;
}
.tech-logo:hover {
    transform: translate3d(0, -5px, 0) !important;
    -webkit-transform: translate3d(0, -5px, 0) !important;
}
/* Header Back Arrow Integrations */
.header-back-arrow {
    color: var(--brand-orange) !important;
    text-decoration: none;
    margin-right: 15px;
    font-size: 0.9em;
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}
.header-back-arrow:hover {
    transform: translateX(-6px);
    color: #e65c00 !important;
}
[dir="rtl"] .header-back-arrow {
    margin-right: 0;
    margin-left: 15px;
}
[dir="rtl"] .header-back-arrow i {
    transform: rotate(180deg);
}
[dir="rtl"] .header-back-arrow:hover {
    transform: translateX(6px);
}
.dark-mode .header-back-arrow {
    color: #FFD700 !important;
}
.dark-mode .header-back-arrow:hover {
    color: #FFC107 !important;
}
/* Consistent Back Navigation Button */
.back-pill-button {
    background-color: rgba(0,0,0,0.3);
    color: #fff !important;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-pill-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.05);
}

.dark-mode .back-pill-button {
    background-color: rgba(255,255,255,0.1);
}

.dark-mode .back-pill-button:hover {
    background-color: rgba(255,255,255,0.25);
}

/* Push Dark Mode Toggle Right of the Back Button gently */
.header-with-back .dark-mode-toggle {
    left: 140px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

@media (max-width: 768px) {
    .back-pill-button {
        top: 15px !important;
        left: 15px !important;
        transform: none !important;
        font-size: 14px;
        padding: 8px 16px;
    }
    .back-pill-button:hover {
        transform: scale(1.05) !important;
    }
    .header-with-back .dark-mode-toggle {
        left: 130px !important;
        top: 15px !important;
        transform: none !important;
    }
}
/* Fancy External Link for Privacy Policy */
.fancy-external-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF6700, #ff8a3d);
    color: #ffffff !important;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(243, 104, 5, 0.3);
    margin: 20px 0;
    width: fit-content;
}

.fancy-external-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(243, 104, 5, 0.4);
    background: linear-gradient(135deg, #ff8a3d, #FF6700);
}

.fancy-external-link i:first-child {
    font-size: 1.3rem;
}

.fancy-external-link i:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

.dark-mode .fancy-external-link {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(243,104,5, 0.3);
}
.dark-mode-toggle:focus-visible,
.arabic-button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

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