/* HIMAYANET.ma - Global Styles */
/* Font and Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap');

/* Root Variables for Consistency */
:root {
    /* Primary Colors - Deep Purple for header/footer */
    --primary-navy: #1e1b4b;
    --primary-navy-light: #4c1d95;
    --secondary-blue: #fbbf24;
    --secondary-blue-dark: #f59e0b;
    
    /* Accent Colors - Gold for icons and highlights */
    --accent-teal: #fbbf24;
    --accent-teal-light: #fcd34d;
    --accent-teal-dark: #f59e0b;
    
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #2f2b6a 0%, #6d28d9 100%);
    --gradient-hero: linear-gradient(135deg, #2f2b6a 0%, #6d28d9 100%);
    --gradient-cta: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --gradient-accent: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    
    /* Text Colors */
    --text-primary: #1e1b4b;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    --text-blue-light: #c4b5fd;
    --text-blue-100: #c4b5fd;
    
    /* Background Colors - White and Light Gray */
    --bg-white: #ffffff;
    --bg-gray-50: #F5F5F5;
    --bg-gray-100: #F5F5F5;
    --bg-gray-900: #1a202c;
    
    /* Border Colors */
    --border-gray-100: #F5F5F5;
    --border-gray-200: #e5e7eb;
    --border-gray-300: #d1d5db;
    --border-gray-800: #1e1b4b;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    min-height: 100vh;
    color: var(--text-white);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
}

h2 {
    font-size: 2.25rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* New Section Styles */
.hero-section {
    background: var(--gradient-hero);
    padding: 6rem 1rem;
    position: relative;
    z-index: 20;
}

/* Ensure all content sections are above the animation */
section {
    position: relative;
    z-index: 20;
}

/* Ensure all text content is above animation */
h1, h2, h3, h4, h5, h6, p, a, div, span {
    position: relative;
    z-index: 25;
}

.mission-card {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mission-card:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px);
}

.savoir-faire-card {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.savoir-faire-card:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.cta-card {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-xl);
}


/* Background Classes */
.hero-gradient {
    background: var(--gradient-hero);
}

.bg-primary-gradient {
    background: var(--gradient-primary);
}

.bg-white {
    background-color: var(--bg-white);
}

.bg-gray-50 {
    background-color: var(--bg-gray-50);
}

.bg-gray-100 {
    background-color: var(--bg-gray-100);
}

.bg-gray-900 {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
}

/* Text Color Classes */
.text-white {
    color: var(--text-white);
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-light {
    color: var(--text-light);
}

.text-blue-100 {
    color: var(--text-blue-100);
}

.text-blue-300 {
    color: #93c5fd;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-600 {
    color: var(--text-secondary);
}

.text-gray-800 {
    color: #1f2937;
}

.text-gray-900 {
    color: var(--text-primary);
}

/* Card Styles */
.service-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    box-shadow: var(--shadow-md);
}

.article-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray-200);
    box-shadow: var(--shadow-md);
}

/* Interactive Elements */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Button Styles */
.cta-button {
    background: var(--gradient-cta);
    transition: all 0.3s ease;
    color: var(--text-white);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(251, 191, 36, 0.3);
}

.read-more-btn {
    background: var(--gradient-hero);
    transition: all 0.3s ease;
    color: var(--text-white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 27, 75, 0.3);
}

/* Icon Styles */
.feature-icon {
    background: var(--gradient-accent);
}

.service-icon {
    background: var(--gradient-cta);
}

.category-badge {
    background: var(--gradient-primary);
    color: var(--text-white);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Navigation Styles */
.nav-blur {
    backdrop-filter: blur(10px);
    background: var(--primary-navy);
    z-index: 9999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* Enhanced navigation button styles */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-teal);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1.5px;
}

.nav-link:hover::after {
    width: 85%;
}

.nav-link:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Form Styles */
input, textarea, select {
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-gray-300);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Utility Classes */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.shadow-2xl {
    box-shadow: var(--shadow-2xl);
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.875rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Network Animation */
.hero-network-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
}

.network-overlay {
    opacity: 0.3;
    mix-blend-mode: multiply;
}

.network-path {
    stroke-dasharray: 8 12;
    animation: networkFlow 12s linear infinite;
    opacity: 0.8;
}

.network-path:nth-child(1) {
    stroke-dasharray: 8 12;
    animation-duration: 12s;
    animation-delay: 0s;
}

.network-path:nth-child(2) {
    stroke-dasharray: 6 10;
    animation-duration: 10s;
    animation-delay: -2s;
}

.network-path:nth-child(3) {
    stroke-dasharray: 10 8;
    animation-duration: 14s;
    animation-delay: -4s;
}

.network-path:nth-child(4) {
    stroke-dasharray: 7 11;
    animation-duration: 11s;
    animation-delay: -6s;
}

.network-path:nth-child(5) {
    stroke-dasharray: 9 7;
    animation-duration: 13s;
    animation-delay: -8s;
}

.network-node {
    animation: nodePulse 3s ease-in-out infinite;
    opacity: 0.9;
}

.network-node:nth-child(6) {
    animation-delay: 0s;
}

.network-node:nth-child(7) {
    animation-delay: 0.6s;
}

.network-node:nth-child(8) {
    animation-delay: 1.2s;
}

.network-node:nth-child(9) {
    animation-delay: 1.8s;
}

.network-node:nth-child(10) {
    animation-delay: 2.4s;
}

@keyframes networkFlow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -200;
    }
}

@keyframes nodePulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .network-path,
    .network-node {
        animation: none !important;
    }
    
    .network-path {
        opacity: 0.4;
    }
    
    .network-node {
        opacity: 0.6;
    }
}

/* Focus States for Accessibility */
.cta-button:focus,
.read-more-btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--secondary-blue);
    outline-offset: 2px;
}

/* Blog Post Specific Styles */
.blog-post-content {
    background-color: var(--bg-white);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem auto;
    margin-top: 6rem; /* Add top margin to account for fixed header */
    box-shadow: var(--shadow-lg);
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4,
.blog-post-content h5,
.blog-post-content h6 {
    color: var(--text-primary);
}

.blog-post-content p,
.blog-post-content li,
.blog-post-content span {
    color: var(--text-secondary);
}

.blog-post-content .text-gray-900 {
    color: var(--text-primary) !important;
}

.blog-post-content .text-gray-600 {
    color: var(--text-secondary) !important;
}

.blog-post-content .text-gray-500 {
    color: var(--text-light) !important;
}

/* Header Placeholder */
#header-placeholder {
    position: relative;
    z-index: 9999;
}

/* Related Articles Section */
.related-articles {
    background-color: var(--bg-white);
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
}

.related-articles h2 {
    color: var(--text-primary);
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .hero-gradient,
    .bg-primary-gradient {
        background: white;
        color: black;
    }
}

/* RTL Support for Arabic Version */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] body {
    font-family: 'Cairo', 'Tajawal', 'Arial', sans-serif;
}

/* RTL Navigation Adjustments */
[dir="rtl"] .nav-link::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* RTL Flexbox Adjustments */
[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .space-x-8 > * + * {
    margin-left: 0;
    margin-right: 2rem;
}

[dir="rtl"] .space-x-4 > * + * {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .space-x-reverse > * + * {
    margin-right: 0;
    margin-left: 1rem;
}

/* RTL Margin/Padding Adjustments */
[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 0.75rem;
}

/* RTL Text Alignment */
[dir="rtl"] .text-left {
    text-align: right;
}

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

/* RTL Grid Adjustments */
[dir="rtl"] .grid {
    direction: rtl;
}

/* RTL List Adjustments */
[dir="rtl"] ul {
    padding-right: 0;
    padding-left: 1.5rem;
}

[dir="rtl"] .list-inside {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* RTL Button and Link Adjustments */
[dir="rtl"] .cta-button,
[dir="rtl"] .read-more-btn {
    direction: rtl;
}

/* RTL Form Adjustments */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

/* RTL Icon Flipping */
[dir="rtl"] svg[class*="arrow"] {
    transform: scaleX(-1);
}

/* RTL Mobile Menu */
[dir="rtl"] #mobile-menu {
    direction: rtl;
    text-align: right;
}

/* RTL Hero Section */
[dir="rtl"] .hero-section {
    direction: rtl;
}

/* RTL Footer */
[dir="rtl"] footer {
    direction: rtl;
    text-align: right;
}

/* RTL Blog Content */
[dir="rtl"] .blog-post-content {
    direction: rtl;
    text-align: right;
}

/* RTL Arabic Typography Enhancements */
[dir="rtl"] {
    line-height: 1.8;
    letter-spacing: 0;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    line-height: 1.6;
    font-weight: 700;
}

/* RTL Arabic Font Sizes */
[dir="rtl"] body {
    font-size: 1rem;
}

[dir="rtl"] p {
    line-height: 1.8;
}

/* RTL Centered Content */
[dir="rtl"] .text-center {
    text-align: center;
}

/* RTL Absolute Positioning Adjustments */
[dir="rtl"] .absolute.left-1\/2 {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* RTL Transform Adjustments */
[dir="rtl"] .transform.-translate-x-1\/2 {
    transform: translateX(50%);
}
