/*
 * Transteceg Design System v2.0
 * Global Design Tokens & Base Styles
 */

/* ============================================
   DESIGN TOKENS
   ============================================ */

:root {
    /* Colors - Primary */
    --tt-navy: #0A1628;
    --tt-navy-light: #132240;
    --tt-blue: #1E5DAB;
    --tt-blue-hover: #164A8A;
    --tt-blue-light: #E8F0FE;
    --tt-gold: #C8A951;
    --tt-gold-light: #E5C76B;
    --tt-gold-dark: #A68B3C;

    /* Colors - Semantic */
    --tt-success: #10B981;
    --tt-error: #EF4444;
    --tt-warning: #F59E0B;

    /* Colors - Surface */
    --tt-surface-light: #F8F9FC;
    --tt-surface-medium: #E8EDF5;
    --tt-surface-dark: #0A1628;
    --tt-border: #D1D5DB;
    --tt-border-light: #E8EDF5;

    /* Colors - Text */
    --tt-text-primary: #1A1D26;
    --tt-text-secondary: #5A6478;
    --tt-text-muted: #8892A4;
    --tt-text-light: #FFFFFF;
    --tt-text-link: #1E5DAB;

    /* Typography */
    --tt-font-ar: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', 'Tajawal', sans-serif;
    --tt-font-en: 'Inter', 'IBM Plex Sans', sans-serif;
    --tt-font-mono: 'IBM Plex Mono', monospace;

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

    /* Font Weights */
    --tt-weight-normal: 400;
    --tt-weight-medium: 500;
    --tt-weight-semibold: 600;
    --tt-weight-bold: 700;

    /* Spacing */
    --tt-space-1: 0.25rem;
    --tt-space-2: 0.5rem;
    --tt-space-3: 0.75rem;
    --tt-space-4: 1rem;
    --tt-space-5: 1.25rem;
    --tt-space-6: 1.5rem;
    --tt-space-8: 2rem;
    --tt-space-10: 2.5rem;
    --tt-space-12: 3rem;
    --tt-space-16: 4rem;
    --tt-space-20: 5rem;
    --tt-space-24: 6rem;

    /* Border Radius */
    --tt-radius-sm: 0.25rem;
    --tt-radius-md: 0.5rem;
    --tt-radius-lg: 0.75rem;
    --tt-radius-xl: 1rem;
    --tt-radius-2xl: 1.5rem;
    --tt-radius-full: 9999px;

    /* Shadows */
    --tt-shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.06);
    --tt-shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08);
    --tt-shadow-lg: 0 8px 24px rgba(10, 22, 40, 0.1);
    --tt-shadow-xl: 0 16px 48px rgba(10, 22, 40, 0.12);
    --tt-shadow-glow: 0 0 30px rgba(30, 93, 171, 0.15);

    /* Transitions */
    --tt-transition-fast: 150ms ease;
    --tt-transition-base: 250ms ease;
    --tt-transition-slow: 400ms ease;
    --tt-transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-Index */
    --tt-z-dropdown: 100;
    --tt-z-sticky: 200;
    --tt-z-fixed: 300;
    --tt-z-modal: 400;
    --tt-z-tooltip: 500;

    /* Container */
    --tt-container-max: 1280px;
    --tt-container-padding: 1.5rem;
}

/* ============================================
   BASE RESETS & GLOBAL STYLES
   Scoped to homepage only to avoid Elementor conflicts
   ============================================ */

/* Only apply aggressive resets on homepage */
.tt-home *,
.tt-home *::before,
.tt-home *::after {
    box-sizing: border-box;
}

/* Global box-sizing for all pages */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--tt-font-ar);
    color: var(--tt-text-primary);
    line-height: 1.7;
    background-color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Respect reduced motion preference */
@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;
    }
}

/* ============================================
   TYPOGRAPHY
   Scoped to avoid Elementor conflicts
   ============================================ */

/* Only apply heading styles outside of Elementor */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--tt-font-ar);
    font-weight: var(--tt-weight-bold);
    color: var(--tt-navy);
    line-height: 1.25;
    margin-bottom: var(--tt-space-4);
}

/* Reset heading margins inside Elementor */
.elementor h1, .elementor h2, .elementor h3, .elementor h4, .elementor h5, .elementor h6 {
    margin-bottom: 0;
}

h1 {
    font-size: var(--tt-text-5xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--tt-text-4xl);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--tt-text-2xl);
}

h4 {
    font-size: var(--tt-text-xl);
}

p {
    margin-bottom: var(--tt-space-4);
    color: var(--tt-text-secondary);
    line-height: 1.75;
}

/* Reset p margins inside Elementor */
.elementor p {
    margin-bottom: 0;
}

a {
    color: var(--tt-text-link);
    text-decoration: none;
    transition: color var(--tt-transition-fast);
}

a:hover {
    color: var(--tt-blue-hover);
}

/* ============================================
   CONTAINER
   ============================================ */

.tt-container {
    max-width: var(--tt-container-max);
    margin: 0 auto;
    padding: 0 var(--tt-container-padding);
}

.tt-container-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--tt-container-padding);
}

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */

.tt-skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--tt-blue);
    color: var(--tt-text-light);
    padding: var(--tt-space-3) var(--tt-space-6);
    z-index: var(--tt-z-tooltip);
    font-weight: var(--tt-weight-semibold);
    border-radius: 0 0 var(--tt-radius-md) 0;
}

.tt-skip-link:focus {
    top: 0;
    color: var(--tt-text-light);
}

/* ============================================
   FOCUS STYLES (Accessibility)
   ============================================ */

:focus-visible {
    outline: 3px solid var(--tt-blue);
    outline-offset: 2px;
    border-radius: var(--tt-radius-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.tt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--tt-space-2);
    padding: 0.875rem 2rem;
    font-family: var(--tt-font-ar);
    font-size: var(--tt-text-base);
    font-weight: var(--tt-weight-semibold);
    line-height: 1;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--tt-radius-lg);
    cursor: pointer;
    transition: all var(--tt-transition-base);
    white-space: nowrap;
}

.tt-btn:focus-visible {
    outline: 3px solid var(--tt-blue);
    outline-offset: 2px;
}

/* Primary Button */
.tt-btn-primary {
    background: var(--tt-blue);
    color: var(--tt-text-light);
    border-color: var(--tt-blue);
    box-shadow: 0 2px 8px rgba(30, 93, 171, 0.25);
}

.tt-btn-primary:hover {
    background: var(--tt-blue-hover);
    border-color: var(--tt-blue-hover);
    box-shadow: 0 4px 16px rgba(30, 93, 171, 0.35);
    transform: translateY(-1px);
    color: var(--tt-text-light);
}

.tt-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 93, 171, 0.25);
}

/* Secondary Button */
.tt-btn-secondary {
    background: transparent;
    color: var(--tt-blue);
    border-color: var(--tt-blue);
}

.tt-btn-secondary:hover {
    background: var(--tt-blue);
    color: var(--tt-text-light);
    transform: translateY(-1px);
}

/* Gold Button */
.tt-btn-gold {
    background: linear-gradient(135deg, var(--tt-gold), var(--tt-gold-light));
    color: var(--tt-navy);
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(200, 169, 81, 0.3);
    font-weight: var(--tt-weight-bold);
}

.tt-btn-gold:hover {
    box-shadow: 0 4px 20px rgba(200, 169, 81, 0.45);
    transform: translateY(-2px);
    color: var(--tt-navy);
}

/* Ghost Button (Dark backgrounds) */
.tt-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: var(--tt-text-light);
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
}

.tt-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--tt-text-light);
}

/* Button Sizes */
.tt-btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--tt-text-sm);
}

.tt-btn-lg {
    padding: 1rem 2.5rem;
    font-size: var(--tt-text-lg);
}

/* Full Width on Mobile */
@media (max-width: 768px) {
    .tt-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
}

/* ============================================
   SECTION UTILITIES
   ============================================ */

.tt-section {
    padding: var(--tt-space-20) 0;
    position: relative;
}

.tt-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 1200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

.tt-section-lg {
    padding: var(--tt-space-24) 0;
}

.tt-section-sm {
    padding: var(--tt-space-12) 0;
}

.tt-section-dark {
    background: var(--tt-navy);
    color: var(--tt-text-light);
}

.tt-section-dark:not(:last-child)::after,
.tt-section-blue:not(:last-child)::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.tt-section-dark h2,
.tt-section-dark h3,
.tt-section-dark h4 {
    color: var(--tt-text-light);
}

.tt-section-dark p {
    color: rgba(255, 255, 255, 0.75);
}

.tt-section-light {
    background: var(--tt-surface-light);
}

.tt-section-alt {
    background: var(--tt-surface-medium);
}

.tt-section-blue {
    background: #F0F4FA;
}

/* Section Headers */
.tt-section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--tt-space-16);
}

.tt-section-header h2 {
    margin-bottom: var(--tt-space-4);
}

.tt-section-header .tt-gold-line {
    display: block;
    width: 60px;
    height: 3px;
    background: var(--tt-gold);
    margin: var(--tt-space-4) auto;
    border-radius: var(--tt-radius-full);
}

.tt-section-header p {
    font-size: var(--tt-text-lg);
    color: var(--tt-text-secondary);
    margin-bottom: 0;
}

/* ============================================
   CARDS
   ============================================ */

.tt-card {
    background: #FFFFFF;
    border-radius: var(--tt-radius-xl);
    padding: var(--tt-space-8);
    border: 1px solid var(--tt-border-light);
    transition: all var(--tt-transition-base);
}

.tt-card:hover {
    box-shadow: var(--tt-shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.tt-card-flat {
    background: #FFFFFF;
    border-radius: var(--tt-radius-xl);
    padding: var(--tt-space-8);
    box-shadow: var(--tt-shadow-sm);
}

/* ============================================
   GRID UTILITIES
   ============================================ */

.tt-grid {
    display: grid;
    gap: var(--tt-space-8);
}

.tt-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tt-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tt-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

@media (max-width: 640px) {
    .tt-grid-2,
    .tt-grid-3,
    .tt-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   BADGES
   ============================================ */

.tt-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--tt-space-2);
    padding: var(--tt-space-2) var(--tt-space-4);
    font-size: var(--tt-text-xs);
    font-weight: var(--tt-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--tt-radius-full);
    background: var(--tt-blue-light);
    color: var(--tt-blue);
}

.tt-badge-gold {
    background: rgba(200, 169, 81, 0.15);
    color: var(--tt-gold-dark);
}

.tt-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tt-success);
}

/* ============================================
   IMAGE UTILITIES
   ============================================ */

.tt-img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

.tt-img-grayscale {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--tt-transition-base);
}

.tt-img-grayscale:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================
   DIVIDER
   ============================================ */

.tt-divider {
    border: none;
    height: 1px;
    background: var(--tt-border-light);
    margin: var(--tt-space-12) 0;
}

.tt-divider-gold {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--tt-gold), transparent);
    border: none;
    margin: var(--tt-space-8) auto;
    width: 80px;
}

/* ============================================
   RTL UTILITIES
   ============================================ */

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

[dir="ltr"] {
    font-family: var(--tt-font-en);
}

/* ============================================
   SCREEN READER ONLY
   ============================================ */

.tt-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes tt-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tt-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tt-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes tt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tt-animate-fade-in-up {
    animation: tt-fade-in-up 0.6s ease-out forwards;
    opacity: 0;
}

.tt-animate-delay-1 { animation-delay: 0.1s; }
.tt-animate-delay-2 { animation-delay: 0.2s; }
.tt-animate-delay-3 { animation-delay: 0.3s; }
.tt-animate-delay-4 { animation-delay: 0.4s; }
.tt-animate-delay-5 { animation-delay: 0.5s; }
.tt-animate-delay-6 { animation-delay: 0.6s; }

/* ============================================
   CUSTOM FOOTER (tt-modern-footer)
   ============================================ */

.tt-modern-footer {
    background-color: var(--tt-navy);
    color: var(--tt-text-light);
    padding: var(--tt-space-16) 0 0 0;
    position: relative;
    overflow: hidden;
    font-family: var(--tt-font-ar);
}

/* Subtle glow effect behind footer */
.tt-modern-footer::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(200, 169, 81, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.tt-footer-container {
    max-width: var(--tt-container-max);
    margin: 0 auto;
    padding: 0 var(--tt-container-padding);
    position: relative;
    z-index: 1;
}

.tt-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--tt-space-12);
    margin-bottom: var(--tt-space-12);
}

.tt-footer-col {
    display: flex;
    flex-direction: column;
}

.tt-footer-brand .tt-footer-logo-text {
    display: inline-block;
    margin-bottom: var(--tt-space-6);
    font-size: var(--tt-text-2xl);
    font-weight: var(--tt-weight-bold);
    color: var(--tt-text-light);
    text-decoration: none;
    transition: color var(--tt-transition-fast);
}

.tt-footer-brand .tt-footer-logo-text:hover {
    color: var(--tt-gold);
}

.tt-footer-brand .tt-footer-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--tt-text-sm);
    line-height: 1.8;
    margin-bottom: var(--tt-space-6);
    max-width: 90%;
}

.tt-footer-social {
    display: flex;
    gap: var(--tt-space-4);
}

.tt-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--tt-radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--tt-text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--tt-transition-base);
}

.tt-footer-social a:hover {
    background: var(--tt-gold);
    color: var(--tt-navy);
    border-color: var(--tt-gold);
    transform: translateY(-3px);
}

.tt-footer-heading {
    color: var(--tt-text-light);
    font-size: var(--tt-text-lg);
    font-weight: var(--tt-weight-bold);
    margin-bottom: var(--tt-space-6);
    position: relative;
    padding-bottom: var(--tt-space-3);
}

.tt-footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--tt-gold);
    border-radius: var(--tt-radius-full);
}

.tt-footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--tt-space-3);
}

.tt-footer-menu li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--tt-text-sm);
    display: inline-flex;
    align-items: center;
    transition: all var(--tt-transition-fast);
}

.tt-footer-menu li a::before {
    content: '←';
    margin-left: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--tt-transition-fast);
    color: var(--tt-gold);
}

.tt-footer-menu li a:hover {
    color: var(--tt-gold);
    transform: translateX(-5px);
}

.tt-footer-menu li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.tt-footer-contact {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: var(--tt-space-4);
}

.tt-contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--tt-space-3);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--tt-text-sm);
    line-height: 1.6;
}

.tt-contact-item svg {
    flex-shrink: 0;
    margin-top: 4px;
}

.tt-contact-item a {
    color: rgba(255, 255, 255, 0.7);
}

.tt-contact-item a:hover {
    color: var(--tt-gold);
}

.tt-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--tt-space-6) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--tt-space-8);
}

.tt-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--tt-text-sm);
    margin: 0;
}

.tt-footer-powered {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--tt-text-sm);
}

.tt-footer-powered a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: var(--tt-weight-bold);
    text-decoration: none;
    transition: color var(--tt-transition-fast);
}

.tt-footer-powered a:hover {
    color: var(--tt-gold);
}

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

@media (max-width: 768px) {
    .tt-footer-grid {
        grid-template-columns: 1fr;
        gap: var(--tt-space-10);
    }
    
    .tt-footer-brand .tt-footer-desc {
        max-width: 100%;
    }
    
    .tt-footer-bottom {
        flex-direction: column;
        gap: var(--tt-space-6);
        text-align: center;
    }
}
