/* ===== CSS VARIABLES FOR VIBRANT PROFESSIONAL THEME ===== */
:root {
    /* Vibrant Professional Palette */
    --background: #FFFFFF;
    --foreground: #003366;

    /* Primary Brand Colors */
    --primary: #003366;
    --primary-light: #336699;
    --primary-dark: #002244;

    /* Accent Colors */
    --accent: #F2C94C;
    --accent-secondary: #00A896;
    --accent-tertiary: #6C63FF;

    /* Neutral Tones */
    --muted: #64748B;
    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;

    /* Effects */
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 30px -10px rgba(0, 51, 102, 0.1);
    --shadow-elevated: 0 20px 40px -10px rgba(0, 51, 102, 0.15);

    /* Legacy references from Process section */
    --copper: #B87333;
    --copper-light: #D4954A;
    --off-white: #FAF8F5;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 168, 150, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(242, 201, 76, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(3.5rem, 8vw, 6rem);
}

h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

p {
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== UTILITY CLASSES ===== */
.section {
    position: relative;
    padding: 6rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--primary-light);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    padding: 1rem 2.5rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(0, 51, 102, 0.05);
    transform: translateY(-2px);
}

/* Section Headings */
.section-heading {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HEADER STYLES ===== */
.logo-container:hover .logo-image {
    transform: rotate(5deg) scale(1.05);
}

.nav-link {
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0;
    position: relative;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary) !important;
}

.mobile-menu-btn {
    display: none !important;
}

/* ===== HERO STYLES ===== */
@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: rotate(0deg);
    }

    100% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
        transform: rotate(5deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* ===== DYNAMIC ORBITAL FLIGHT ANIMATIONS ===== */
/* These move panels across the whole space, including the center */
@keyframes orbit-1 {
    0% {
        transform: translate(-20%, -20%) rotate(0deg);
    }

    33% {
        transform: translate(40%, 10%) rotate(2deg);
    }

    66% {
        transform: translate(10%, 40%) rotate(-1deg);
    }

    100% {
        transform: translate(-20%, -20%) rotate(0deg);
    }
}

@keyframes orbit-2 {
    0% {
        transform: translate(30%, 30%) rotate(0deg);
    }

    33% {
        transform: translate(-40%, -10%) rotate(-3deg);
    }

    66% {
        transform: translate(-10%, -40%) rotate(2deg);
    }

    100% {
        transform: translate(30%, 30%) rotate(0deg);
    }
}

@keyframes orbit-3 {
    0% {
        transform: translate(-50%, 20%) rotate(0deg);
    }

    50% {
        transform: translate(50%, -20%) rotate(5deg);
    }

    100% {
        transform: translate(-50%, 20%) rotate(0deg);
    }
}

@keyframes orbit-4 {
    0% {
        transform: translate(40%, -40%) rotate(0deg);
    }

    25% {
        transform: translate(-30%, -20%) rotate(-2deg);
    }

    50% {
        transform: translate(10%, 30%) rotate(2deg);
    }

    75% {
        transform: translate(-40%, 10%) rotate(1deg);
    }

    100% {
        transform: translate(40%, -40%) rotate(0deg);
    }
}

@keyframes orbit-5 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-60%, 40%) rotate(-10deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes orbit-6 {
    0% {
        transform: translate(-30%, 50%) rotate(0deg);
    }

    50% {
        transform: translate(40%, -50%) rotate(10deg);
    }

    100% {
        transform: translate(-30%, 50%) rotate(0deg);
    }
}

.orbit-1 {
    animation: orbit-1 25s ease-in-out infinite;
}

.orbit-2 {
    animation: orbit-2 30s ease-in-out infinite;
}

.orbit-3 {
    animation: orbit-3 20s ease-in-out infinite;
}

.orbit-4 {
    animation: orbit-4 35s ease-in-out infinite;
}

.orbit-5 {
    animation: orbit-5 28s ease-in-out infinite;
}

.orbit-6 {
    animation: orbit-6 32s ease-in-out infinite;
}

/* ===== SERVICES STYLES ===== */
@keyframes electric-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--card-glow-color),
            0 0 10px var(--card-glow-color),
            0 0 15px var(--card-glow-color),
            0 2px 8px rgba(0, 0, 0, 0.04);
    }

    50% {
        box-shadow: 0 0 10px var(--card-glow-color),
            0 0 20px var(--card-glow-color),
            0 0 30px var(--card-glow-color),
            0 0 40px var(--card-glow-color),
            0 8px 16px rgba(0, 0, 0, 0.1);
    }
}

.service-card-electric:hover {
    transform: translateY(-8px);
    border-color: var(--card-glow-color);
    animation: electric-pulse 1.5s ease-in-out infinite;
}

.service-card-electric:hover .service-icon-electric {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.service-card-electric:hover .service-link-electric {
    gap: 0.75rem;
}

.service-link-electric .arrow {
    transition: transform 0.3s ease;
}

.service-card-electric:hover .service-link-electric .arrow {
    transform: translateX(5px);
}

/* ===== WHY US STYLES ===== */
.why-card:hover {
    transform: translateY(-8px);
    border-color: var(--why-glow);
    box-shadow: 0 0 8px var(--why-glow), 0 0 16px var(--why-glow), 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.why-card:hover .why-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===== PORTFOLIO STYLES ===== */
.portfolio-card:hover {
    transform: translateY(-8px);
    border-color: var(--portfolio-glow);
    box-shadow: 0 0 8px var(--portfolio-glow), 0 0 16px var(--portfolio-glow), 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.portfolio-card:hover .portfolio-link {
    gap: 0.75rem;
}

.portfolio-card:hover .portfolio-arrow {
    transform: translateX(5px);
}

.portfolio-arrow {
    transition: transform 0.3s ease;
}

/* ===== FAQ STYLES ===== */
.faq-item {
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 16px rgba(0, 51, 102, 0.08);
}

.faq-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== CONTACT STYLES ===== */
.contact-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1) !important;
}

.contact-method-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 51, 102, 0.1);
    border-color: var(--primary);
}

.contact-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.2);
}

/* ===== FOOTER LINK HOVER ===== */
.footer-link:hover {
    color: var(--accent) !important;
}

.social-link:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* ===== PORTFOLIO MODAL ===== */
.portfolio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 15, 40, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.portfolio-modal-overlay.active {
    display: flex;
}

.portfolio-modal-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    display: none;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--card-border);
    padding: 2rem;
    height: 100vh;
    position: absolute;
    width: 100%;
    top: 100%;
    left: 0;
    backdrop-filter: blur(20px);
}

.mobile-menu.active {
    display: block;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    animation: fadeInUp 0.3s ease-out;
}

.success-message.show {
    display: block;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* New Header Integrated Language Toggle */
.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 51, 102, 0.05);
    border: 1px solid rgba(0, 51, 102, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    font-weight: 600;
}

.lang-toggle-btn:hover {
    background: rgba(0, 51, 102, 0.08);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.btn-lang-code {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-toggle-btn:hover .btn-lang-code {
    transform: rotate(360deg);
}

[dir="rtl"] .lang-toggle-btn {
    flex-direction: row-reverse;
}

@media (max-width: 1024px) {
    .lang-toggle-btn {
        padding: 0.4rem 0.6rem;
    }

    .lang-toggle-btn .lang-text {
        display: none;
        /* Only show icon on mobile header to save space */
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .hero-visual {
        display: none !important;
    }

    h1 {
        font-size: 3.5rem !important;
    }

    .faq-grid {
        grid-template-columns: 1fr !important;
    }

    .contact-main-grid {
        grid-template-columns: 1fr !important;
    }

    .contact-methods-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .service-card-electric {
        padding: 1.5rem !important;
    }

    .why-card {
        padding: 1.5rem !important;
    }

    .portfolio-card-inner {
        padding: 1.5rem !important;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .contact-methods-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ===== RTL SUPPORT & ARABIC STYLING ===== */
[lang="ar"] {
    font-family: 'Noto Sans Arabic', sans-serif;
}

[lang="ar"] body {
    text-align: right;
}

[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] h6 {
    font-family: 'Noto Sans Arabic', sans-serif;
    font-weight: 700;
}

/* Mirror icons and arrows in RTL */
[dir="rtl"] .service-link-electric .arrow,
[dir="rtl"] .portfolio-arrow,
[dir="rtl"] .faq-chevron svg {
    transform: scaleX(-1);
}

[dir="rtl"] .service-card-electric:hover .service-link-electric .arrow,
[dir="rtl"] .portfolio-card:hover .portfolio-arrow {
    transform: scaleX(-1) translateX(5px);
}

/* Adjust margins/padding that are side-specific */
[dir="rtl"] .faq-number {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .faq-item p {
    padding: 0 calc(36px + 1rem) 0 0 !important;
}

/* Desktop Nav margins */
@media (min-width: 1025px) {
    [dir="rtl"] .desktop-nav {
        margin-right: auto;
        margin-left: 0;
    }
}

/* Contact form errors */
[dir="rtl"] .form-error {
    text-align: right;
}

/* Mobile menu adjustment */
[dir="rtl"] .mobile-menu {
    text-align: right;
}

/* Footer branding */
[dir="rtl"] .logo-container {
    flex-direction: row-reverse;
}

/* Success message */
[dir="rtl"] .success-message {
    text-align: center;
}

/* Specific component tweaks */
[dir="rtl"] .section-heading::after {
    right: 0;
    left: auto;
}

/* Portfolio Link Hover in RTL */
[dir="rtl"] .portfolio-card:hover .portfolio-arrow {
    transform: scaleX(-1) translateX(5px);
}

/* FAQ Chevron rotation in RTL */
[dir="rtl"] .faq-item .faq-chevron svg {
    transform: scaleX(-1) rotate(0deg);
}

/* Add a class to help with RTL-specific hiding/showing if needed */
[dir="rtl"] .hide-rtl {
    display: none !important;
}

[dir="ltr"] .hide-ltr {
    display: none !important;
}