/* Base Font & Body Style */
body {
    font-family: 'Tajawal', sans-serif;
    color: #374151;
    line-height: 1.6;
    background-color: #f9fafb;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Enhanced Color Variables */
:root {
    /* Primary Colors - Emerald */
    --color-primary-50: #ecfdf5;
    --color-primary-100: #d1fae5;
    --color-primary-200: #a7f3d0;
    --color-primary-300: #6ee7b7;
    --color-primary-400: #34d399;
    --color-primary-500: #10b981;
    --color-primary-600: #059669;
    --color-primary-700: #047857;
    --color-primary-800: #065f46;
    --color-primary-900: #064e3b;

    /* Accent Colors - Amber */
    --color-accent-50: #fffbeb;
    --color-accent-100: #fef3c7;
    --color-accent-200: #fde68a;
    --color-accent-300: #fcd34d;
    --color-accent-400: #fbbf24;
    --color-accent-500: #f59e0b;
    --color-accent-600: #d97706;
    --color-accent-700: #b45309;
    --color-accent-800: #92400e;
    --color-accent-900: #78350f;

    /* Neutral Colors */
    --color-neutral-50: #f9fafb;
    --color-neutral-100: #f3f4f6;
    --color-neutral-200: #e5e7eb;
    --color-neutral-300: #d1d5db;
    --color-neutral-400: #9ca3af;
    --color-neutral-500: #6b7280;
    --color-neutral-600: #4b5563;
    --color-neutral-700: #374151;
    --color-neutral-800: #1f2937;
    --color-neutral-900: #111827;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;

    /* Transitions */
    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-900);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: 1rem;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Enhanced Animations with Variables */
.fade-in {
    animation: fadeIn var(--transition-slow) var(--easing-decelerate);
    will-change: opacity;
}

.slide-in-right {
    animation: slideInRight var(--transition-normal) var(--easing-decelerate);
    will-change: transform, opacity;
}

.slide-in-left {
    animation: slideInLeft var(--transition-normal) var(--easing-decelerate);
    will-change: transform, opacity;
}

.scale-in {
    animation: scaleIn var(--transition-normal) var(--easing-standard);
    will-change: transform, opacity;
}

/* Advanced animations */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    will-change: transform, opacity;
}

.pulse {
    animation: pulse 2s infinite var(--easing-standard);
    will-change: transform;
}

.float {
    animation: float 3s ease-in-out infinite;
    will-change: transform;
}

.tilt {
    animation: tilt 10s infinite linear;
    will-change: transform;
}

/* New Animations */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(
            to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 3s infinite;
    transform: skewX(-20deg);
}

@keyframes shimmer {
    0% { transform: translateX(-150%) skewX(-20deg); }
    100% { transform: translateX(300%) skewX(-20deg); }
}

.reveal {
    animation: reveal 1s var(--easing-decelerate);
    will-change: clip-path;
}

@keyframes reveal {
    0% { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

/* Enhanced Hover effect animations */
.hover-lift {
    transition: transform var(--transition-normal) var(--easing-standard),
    box-shadow var(--transition-normal) var(--easing-standard);
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.hover-grow {
    transition: transform var(--transition-normal) var(--easing-standard);
}
.hover-grow:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-normal) var(--easing-decelerate),
    transform var(--transition-normal) var(--easing-decelerate);
}
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--color-primary-500), 0.3);
    transform: translateY(-3px);
}

/* New hover effects */
.hover-border {
    position: relative;
}
.hover-border::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary-600);
    transition: width var(--transition-normal) var(--easing-standard);
}
.hover-border:hover::after {
    width: 100%;
}

.hover-rotate {
    transition: transform var(--transition-normal) var(--easing-standard);
}
.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Enhanced Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    40% { transform: scale(1.08); }
    60% { transform: scale(0.94); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes tilt {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(0.8deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-0.8deg); }
    100% { transform: rotate(0deg); }
}

/* Refined Hover effect animations */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.26, 0.86, 0.44, 0.985),
    box-shadow 0.3s cubic-bezier(0.26, 0.86, 0.44, 0.985);
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.hover-grow {
    transition: transform 0.3s cubic-bezier(0.26, 0.86, 0.44, 0.985);
}
.hover-grow:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 15px rgba(4, 120, 87, 0.3);
    transform: translateY(-3px);
}

/* Enhanced Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    40% { transform: scale(1.08); }
    60% { transform: scale(0.94); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes tilt {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(0.8deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-0.8deg); }
    100% { transform: rotate(0deg); }
}

/* Enhanced Background styles */
.gradient-bg {
    background: linear-gradient(135deg, var(--color-primary-800) 0%, var(--color-primary-600) 100%);
}

.animated-gradient-bg {
    background: linear-gradient(-45deg, var(--color-primary-900), var(--color-primary-700), var(--color-primary-600), var(--color-accent-600));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Refined Card shadows and hover effects */
.shadow-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-normal) var(--easing-standard);
    border: 1px solid rgba(229, 231, 235, 0.8);
    will-change: transform, box-shadow;
}

.shadow-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
    border-color: rgba(var(--color-primary-200), 0.8);
}

/* Enhanced Highlight effects */
.highlight-item {
    position: relative;
    overflow: hidden;
}

.highlight-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-primary-100), 0.08);
    transform: translateX(-100%);
    transition: transform var(--transition-normal) var(--easing-decelerate);
}

.highlight-item:hover::before {
    transform: translateX(0);
}

/* Enhanced Text effects */
.text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.text-outline {
    -webkit-text-stroke: 1px rgba(var(--color-primary-800), 0.3);
    color: transparent;
}

/* New text effects */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-rise {
    display: inline-block;
    transition: transform var(--transition-normal) var(--easing-decelerate);
}
.text-rise:hover {
    transform: translateY(-3px);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all var(--transition-normal) var(--easing-standard);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-primary-700);
    color: white;
    border: 2px solid var(--color-primary-700);
}

.btn-primary:hover {
    background-color: var(--color-primary-800);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary-700);
    border: 2px solid var(--color-primary-700);
}

.btn-secondary:hover {
    background-color: var(--color-primary-50);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--color-accent-500);
    color: white;
    border: 2px solid var(--color-accent-500);
}

.btn-accent:hover {
    background-color: var(--color-accent-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Custom dividers */
.divider {
    position: relative;
    height: 1px;
    background: var(--color-neutral-200);
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 6px;
    width: 50px;
    background: var(--color-primary-500);
    border-radius: 3px;
}

.divider-left::before {
    left: 0;
    transform: translateY(-50%);
}

.divider-right::before {
    left: auto;
    right: 0;
    transform: translateY(-50%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-400);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    .py-8 {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }

    .divider::before {
        width: 40px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode-support {
        --color-neutral-50: #18191A;
        --color-neutral-100: #242526;
        --color-neutral-200: #3A3B3C;
        --color-neutral-800: #E4E6EB;
        --color-neutral-900: #F5F6F7;
    }
}

/* Print styling for contact saving */
@media print {
    body * {
        visibility: hidden;
    }

    .print-section, .print-section * {
        visibility: visible;
    }

    .print-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .no-print {
        display: none;
    }
}

[dir="rtl"] {
    .space-x-4 > :not(template) ~ :not(template) {
        --space-x-reverse: 0 !important;
        margin-left: calc(1rem * var(--space-x-reverse)) !important;
        margin-right: calc(1rem * calc(1 - var(--space-x-reverse))) !important;
    }
}
