/**
 * Unified Stylesheet
 * Consolidated from: main.css, animations.css, portfolio.css, and inline styles
 */

/* ==========================================================================
   1. CSS Variables / Design Tokens
   ========================================================================== */

:root {
    /* Primary Colors */
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;

    /* Secondary Colors */
    --secondary: #15803d;
    --accent: #dc2626;
    --gold: #eab308;

    --border-color: black;

    /* Neutral Colors */
    --dark: #0f172a;
    --light: #f8fafc;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #475569;
    --border: #e2e8f0;

    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-arabic: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

body[dir="rtl"] {
    font-family: var(--font-arabic);
}

/* ==========================================================================
   3. Layout Components
   ========================================================================== */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */

.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.lang-toggle {
    display: flex;
    gap: var(--spacing-xs);
}

.lang-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==========================================================================
   5. Hero Section
   ========================================================================== */

.hero {
    position: relative;
    min-height: 600px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-pattern.svg') no-repeat center;
    background-size: cover;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-image {
    flex-shrink: 0;
}

.hero-image img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-text .subtitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.hero-text .tagline {
    font-size: 1.125rem;
    opacity: 0.85;
    margin-bottom: 2rem;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.btn-hero-primary {
    background: white;
    color: var(--primary);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid white;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   6. Statistics Section
   ========================================================================== */

.stats-section {
    background: var(--light);
    padding: 4rem 0;
    margin-top: -3rem;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 0 auto;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* ==========================================================================
   7. Sections & Headings
   ========================================================================== */

.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   8. Cards
   ========================================================================== */

.card {
    background: var(--bg-white);
    border-radius: 0.5rem;
    padding: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

/* Inquiry Cards */
.inquiry-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.inquiry-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.inquiry-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.inquiry-ref {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(30, 58, 138, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
}

.inquiry-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.inquiry-desc {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.inquiry-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-gray);
    align-items: center;
}

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.service-desc {
    color: var(--text-gray);
    font-size: 0.875rem;
}

/* ==========================================================================
   9. Forms
   ========================================================================== */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ==========================================================================
   10. Buttons
   ========================================================================== */

.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   11. Alerts
   ========================================================================== */

.alert {
    padding: var(--spacing-md);
    border-radius: 0.375rem;
    margin-bottom: var(--spacing-md);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* ==========================================================================
   12. Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(21, 128, 61, 0.1);
    color: var(--secondary);
}

/* ==========================================================================
   13. Loading & Spinners
   ========================================================================== */

.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: var(--spacing-lg) auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 0.6s linear infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   14. Animations
   ========================================================================== */

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

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

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-scale {
    animation: scaleIn 0.4s ease-out forwards;
}

/* Stagger Animations */
.stagger-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.stagger-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.stagger-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.stagger-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Prevent animation on page load */
.preload * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

/* ==========================================================================
   15. Utility Classes
   ========================================================================== */

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none;
}

/* ==========================================================================
   16. Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .card {
        padding: var(--spacing-md);
    }

    .hero {
        min-height: auto;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 3rem 0;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text .subtitle {
        font-size: 1.25rem;
    }

    .hero-image img {
        width: 200px;
        height: 200px;
    }

    .hero-ctas {
        justify-content: center;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}