:root {
    --primary: #020617;
    --primary-light: #0f172a;
    --accent: #00d2ff; /* Electric Blue/Cyan */
    --accent-glow: rgba(0, 210, 255, 0.4);
    --secondary: #3a7bd5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-dark: #020617;
    --glass: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic High-Tech Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 210, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(58, 123, 213, 0.03) 0%, transparent 50%);
    z-index: -2;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main, 'Tajawal', sans-serif);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

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

@keyframes float-shape {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.shape {
    position: absolute;
    background: var(--accent-glow);
    filter: blur(1px);
    z-index: -1;
    border: 1px solid var(--accent);
    opacity: 0.1;
    pointer-events: none;
    animation: float-shape 20s linear infinite alternate;
}

.shape-1 { width: 100px; height: 100px; top: 10%; left: 5%; clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.shape-2 { width: 150px; height: 150px; bottom: 10%; right: 5%; border-radius: 50%; animation-delay: -5s; }
.shape-3 { width: 80px; height: 80px; top: 50%; left: 50%; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); animation-delay: -10s; }

.animate {
    animation: fadeIn 1s ease-out forwards;
}

.reveal-init {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal {
    opacity: 1;
    transform: translateY(0);
}

#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--secondary));
    z-index: 2000;
    transition: width 0.1s ease-out;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

nav.scrolled {
    padding: 0.5rem 0;
    background: rgba(2, 6, 23, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: var(--transition);
}

.logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
    background: #fff;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo-text span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.4), var(--bg-dark));
    z-index: 1;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.hero .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    color: #fff;
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #fff;
    box-shadow: 0 10px 20px -5px var(--accent-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.02);
}

.btn-full {
    width: 100% !important;
}

.btn-lang {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition);
    margin-inline-start: 1rem;
}

.btn-lang:hover {
    background: var(--accent);
    color: #fff;
}

.nav-cta {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.btn-secondary {
    color: #fff;
    margin-inline-start: 1rem;
    border: 1px solid var(--glass-border);
}

/* Section Common */
section {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    padding: 3rem;
    border-radius: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 40px -10px var(--accent-glow);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.card:hover::after {
    opacity: 1;
}

.card i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: block;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
}

/* Services Section Specific */
.service-icon-box {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* About Section */
.about-flex {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .about-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .vision-list {
        display: inline-block;
        text-align: right;
    }
}

.about-content {
    flex: 1;
}

.about-img {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* Vision Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.about-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.vision-box {
    padding: 2rem;
    border-radius: 20px;
}

.vision-title {
    color: var(--accent);
    margin-bottom: 1rem;
}

.vision-list {
    list-style: none;
    color: var(--text-muted);
}

.vision-list li {
    margin-bottom: 0.8rem;
}

.vision-list li i {
    color: var(--accent);
    margin-left: 0.5rem;
}

.section-alt {
    background: rgba(255, 255, 255, 0.02);
}

/* Portfolio/Projects */
.project-card {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 210, 255, 0.2);
}

.project-img {
    height: 200px;
    background-position: center;
    background-size: cover;
}

.project-logo-img {
    max-width: 85%;
    max-height: 70%;
    object-fit: contain;
}

.logo-filter {
    /* Turns white logos into theme blue */
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(201deg) brightness(101%) contrast(101%);
}

.litc-header {
    background: var(--primary) !important;
}

.madar-header {
    background: #fff !important; /* White background to match the logo's background */
}

.project-img-placeholder {
    height: 200px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img-placeholder i {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 0;
}

.project-body {
    padding: 1.5rem;
}

.project-body h3 {
    font-family: var(--font-display);
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.project-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.project-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.expand-hint {
    text-align: center;
    color: var(--accent);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: var(--transition);
    opacity: 0.6;
}

.project-card:hover .expand-hint {
    transform: rotate(180deg);
    opacity: 0;
}

.project-list {
    list-style: none;
    padding: 0;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-list {
    max-height: 800px;
    opacity: 1;
    margin-top: 1rem;
}

.project-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    position: relative;
    padding-inline-start: 1.5rem;
    line-height: 1.5;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-list li {
    transform: translateY(0);
    opacity: 1;
}

.project-card:hover .project-list li:nth-child(1) { transition-delay: 0.2s; }
.project-card:hover .project-list li:nth-child(2) { transition-delay: 0.3s; }
.project-card:hover .project-list li:nth-child(3) { transition-delay: 0.4s; }
.project-card:hover .project-list li:nth-child(4) { transition-delay: 0.5s; }
.project-card:hover .project-list li:nth-child(5) { transition-delay: 0.6s; }
.project-card:hover .project-list li:nth-child(6) { transition-delay: 0.7s; }

.project-list li::before {
    content: '•';
    position: absolute;
    inset-inline-start: 0;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.9), transparent);
}

/* Quality & Safety Section */
.quality-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.quality-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.quality-stats .stat-card {
    text-align: center;
    padding: 30px 20px;
    transition: transform 0.3s;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.quality-stats .stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 800;
}

.quality-stats p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.check-list {
    list-style: none;
    padding: 0;
}

.check-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 1.05rem;
    color: var(--text-light);
    text-align: start; /* Fix alignment depending on direction */
}

.check-list li i {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 4px; /* Align icon with first line of text */
}

/* Contact Section Layout */

.contact-grid {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-form {
    flex: 1.5;
    min-width: 350px;
    padding: 3rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .contact-grid {
        flex-direction: column;
    }
    
    .contact-info, .contact-form {
        width: 100%;
    }
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateX(10px);
    border-color: var(--accent);
}

.contact-item i {
    font-size: 2rem;
    color: var(--accent);
    background: rgba(0, 210, 255, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.contact-desc {
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.contact-info h3 {
    font-family: var(--font-display);
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Form Styling */
.contact-form {
    background: var(--glass);
    border: 1px solid var(--glass-border);
}

.form-group-spacing {
    margin-bottom: 1.5rem;
}

.btn-full {
    width: 100%;
}

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

/* Bulletproof Org Tree Styling */
.org-tree-container {
    padding: 4rem 0;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    -ms-overflow-style: none;
}

@supports (scrollbar-width: none) {
    .org-tree-container {
        scrollbar-width: none;
    }
}

/* Hide scrollbars for Chrome, Safari and Opera */
.org-tree-container::-webkit-scrollbar {
    display: none;
}

.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 3rem; /* Increased horizontal spacing between sibling boxes */
}

.node-content {
    padding: 2rem 2.5rem;
    border-radius: 12px;
    text-align: center;
    min-width: 220px;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    background: #0f172a;
    position: relative;
    z-index: 10;
}

.node-content:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow);
}

.node-content i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
    display: block;
}

.node-content h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.node-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Branch Container */
.tree-branches {
    display: flex;
    justify-content: center;
    position: relative;
    padding-top: 5rem; /* Increased vertical spacing from parent */
}

/* Main line from parent to branches */
.tree-node.root > .tree-branches::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    width: 2px;
    height: 7rem; /* Increased line length to match padding */
    background: var(--accent);
    transform: translateX(-50%);
    opacity: 0.4;
}

/* Sub-nodes vertical and horizontal lines */
.tree-branches > .tree-node {
    padding-top: 3rem; /* Increased vertical spacing to horizontal line */
}

.tree-branches > .tree-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 3rem; /* Increased vertical connector line */
    background: var(--accent);
    opacity: 0.4;
    transform: translateX(-50%);
}

.tree-branches > .tree-node::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 2px;
    background: var(--accent);
    opacity: 0.4;
}

.tree-branches > .tree-node:first-child::after {
    right: 0;
}

.tree-branches > .tree-node:last-child::after {
    left: 0;
}

.tree-branches > .tree-node:not(:first-child):not(:last-child)::after {
    width: 100%;
    left: 0;
}

/* Hide line for single child */
.tree-branches > .tree-node:only-child::after {
    display: none;
}

/* Vertical line for the single child below management */
.tree-sub-branches {
    padding-top: 4rem;
    position: relative;
}

.tree-sub-branches::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 4rem;
    background: var(--accent);
    opacity: 0.4;
    transform: translateX(-50%);
}

/* Animations */
.tree-node {
    opacity: 0;
}

.reveal .tree-node {
    animation: nodeAppear 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

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

/* Delay for branches */
.tree-node.root { animation-delay: 0.1s; }
.tree-branches > .tree-node:nth-child(1) { animation-delay: 0.3s; }
.tree-branches > .tree-node:nth-child(2) { animation-delay: 0.5s; }
.tree-branches > .tree-node:nth-child(3) { animation-delay: 0.7s; }
.tree-sub-branches .tree-node { animation-delay: 0.9s; }

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    outline: none;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--accent);
}

/* Footer */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-logo {
    margin-bottom: 2rem;
}

.footer-logo-img {
    height: 60px;
    filter: grayscale(1) brightness(2);
    opacity: 0.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .quality-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(2, 6, 23, 0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s ease;
        z-index: 999;
        display: flex; /* Override display: none */
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .nav-cta {
        display: none; /* Hide consultation button in nav for mobile to save space */
    }

    .quality-stats { grid-template-columns: 1fr; }
    
    /* Org Tree Mobile Fix */
    .tree-branches {
        flex-direction: column;
        padding-top: 2rem;
    }

    .tree-branches::before {
        display: none;
    }

    .tree-node::after, .tree-node::before {
        display: none !important;
    }

    .tree-node {
        padding: 1rem 0;
    }

    .tree-sub-branches::before {
        display: none;
    }

    .tree-sub-branches {
        padding-top: 1rem;
    }
}


