/* ===================================
   KARIM ELSHORBAGY - INTERACTIVE WEBSITE
   Mud Logger & Geologist Experience
   =================================== */

/* CSS Custom Properties */
:root {
    /* Colors - Professional Petroleum Industry Palette */
    --primary: #0f172a;
    /* Deep slate blue */
    --primary-light: #1e293b;
    /* Lighter slate */
    --primary-dark: #020617;
    /* Near black */

    /* Accent - Warm copper/bronze (oil industry) */
    --accent: #f97316;
    /* Vibrant orange */
    --accent-light: #fb923c;
    /* Light orange */
    --accent-dark: #ea580c;
    /* Deep orange */

    /* Secondary accent - Teal (for contrast) */
    --secondary: #14b8a6;
    /* Teal */
    --secondary-light: #2dd4bf;

    /* Industry colors - matching reference */
    --oil-black: #18181b;
    --rock-brown: #3d2b1f;
    /* Dark brown topsoil */
    --sand-yellow: #c9a227;
    /* Golden sandstone */
    --shale-gray: #4a5568;
    /* Slate blue-gray shale */
    --limestone-cream: #d4c5a9;
    /* Beige limestone */

    /* Status colors */
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #eab308;

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-ar: 'Cairo', sans-serif;
    --font-display: 'Orbitron', monospace;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Spacing for mobile */
    --section-padding: 80px 0;
    --container-padding: 20px;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-main);
    background: var(--primary);
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Hide cursor trail element */
.cursor-trail {
    display: none;
}

/* ===================================
   LANGUAGE TOGGLE
   =================================== */
.lang-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    background: var(--accent);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

body[dir="rtl"] .lang-toggle {
    right: auto;
    left: 16px;
}

.lang-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.5);
}

.lang-toggle:active {
    transform: scale(0.98);
}

.lang-en,
.lang-ar {
    display: none;
}

body[dir="ltr"] .lang-en {
    display: inline;
}

body[dir="rtl"] .lang-ar {
    display: inline;
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 0;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Mini Rig Logo */
.logo-rig {
    width: 24px;
    height: 32px;
    position: relative;
}

.rig-tower {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 24px solid var(--accent);
}

.rig-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition-normal);
}

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

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

body[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding-top: 60px;
}

/* Animated Background - Subtle Grid + Glow */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(249, 115, 22, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 75%, rgba(20, 184, 166, 0.08) 0%, transparent 40%);
    animation: glowPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {

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

    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Seismic Background */
.seismic-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    overflow: hidden;
    opacity: 0.6;
}

.seismic-wave {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
}

.wave {
    fill: none;
    stroke-width: 1.5;
    animation: seismicMove 10s linear infinite;
}

.wave-1 {
    stroke: rgba(249, 115, 22, 0.4);
}

.wave-2 {
    stroke: rgba(249, 115, 22, 0.25);
    animation-delay: -3s;
}

.wave-3 {
    stroke: rgba(249, 115, 22, 0.15);
    animation-delay: -6s;
}

@keyframes seismicMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Drilling Rig Animation */
.drilling-rig {
    position: absolute;
    right: 8%;
    bottom: 0;
    width: 250px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.9;
}

body[dir="rtl"] .drilling-rig {
    right: auto;
    left: 8%;
}

.rig-structure {
    position: relative;
    width: 100%;
    height: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
}

.derrick {
    position: relative;
    width: 70px;
    height: 200px;
}

.derrick-frame {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 180px solid var(--accent);
    opacity: 0.85;
}

.derrick-frame::before {
    content: '';
    position: absolute;
    top: 150px;
    left: -20px;
    width: 40px;
    height: 2px;
    background: var(--accent-dark);
}

.traveling-block {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 12px;
    background: var(--text-light);
    border-radius: 2px;
    animation: travelingBlock 2.5s ease-in-out infinite;
}

@keyframes travelingBlock {

    0%,
    100% {
        top: 30px;
    }

    50% {
        top: 60px;
    }
}

.drill-string {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: drillString 2.5s ease-in-out infinite;
}

@keyframes drillString {

    0%,
    100% {
        top: 42px;
    }

    50% {
        top: 72px;
    }
}

.pipe {
    width: 3px;
    height: 40px;
    background: linear-gradient(90deg, #555, #888, #555);
}

.drill-bit {
    width: 10px;
    height: 16px;
    background: linear-gradient(180deg, #666, #333);
    clip-path: polygon(0 0, 100% 0, 75% 100%, 25% 100%);
    animation: drillRotate 0.4s linear infinite;
}

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

.rig-floor {
    width: 80px;
    height: 8px;
    background: var(--rock-brown);
    border-radius: 2px;
    margin-top: -4px;
}

.mud-tank {
    width: 50px;
    height: 25px;
    background: var(--shale-gray);
    border-radius: 4px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.mud-flow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, var(--rock-brown), #3d3427);
    animation: mudPump 1.5s ease-in-out infinite;
}

@keyframes mudPump {

    0%,
    100% {
        height: 50%;
    }

    50% {
        height: 65%;
    }
}

/* Ground Layers - Colors matching reference */
.ground-layers {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.layer {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.layer-soil {
    background: linear-gradient(180deg, #3d2b1f 0%, #2a1d14 100%);
}

.layer-sand {
    background: linear-gradient(180deg, #c9a227 0%, #a6851e 100%);
}

.layer-shale {
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
}

.layer-limestone {
    background: linear-gradient(180deg, #d4c5a9 0%, #b8a88a 100%);
}

.layer-oil {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    position: relative;
}

.oil-bubble {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.7;
    animation: bubbleRise 2.5s ease-in-out infinite;
}

.oil-bubble:nth-child(1) {
    left: 25%;
    animation-delay: 0s;
}

.oil-bubble:nth-child(2) {
    left: 50%;
    animation-delay: 0.8s;
}

.oil-bubble:nth-child(3) {
    left: 75%;
    animation-delay: 1.6s;
}

@keyframes bubbleRise {
    0% {
        bottom: 0;
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 0.7;
    }

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

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 550px;
    padding: 0 var(--container-padding);
}

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

.hero-badge {
    display: inline-block;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    margin-bottom: 16px;
    color: var(--accent-light);
    animation: fadeInUp 0.5s ease-out;
}

.hero-title {
    font-size: clamp(36px, 8vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-title span {
    display: block;
}

.hero-title-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 3vw, 20px);
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 12px;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

.hero-description {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.35);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--glass-border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Depth Counter */
.depth-counter {
    position: absolute;
    bottom: 80px;
    right: 24px;
    text-align: right;
    z-index: 10;
}

body[dir="rtl"] .depth-counter {
    right: auto;
    left: 24px;
    text-align: left;
}

.depth-label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    font-family: var(--font-display);
}

.depth-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-display);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.drill-arrow {
    width: 16px;
    height: 24px;
    position: relative;
}

.drill-arrow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    animation: drillDown 1.5s ease-in-out infinite;
}

.drill-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--accent);
    animation: drillDown 1.5s ease-in-out infinite;
}

@keyframes drillDown {

    0%,
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    50% {
        opacity: 0.4;
        transform: translateX(-50%) translateY(8px);
    }
}

.scroll-indicator span {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

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

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

/* ===================================
   SECTIONS
   =================================== */
.section {
    padding: var(--section-padding);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-tag {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
}

/* ===================================
   DRILLING SIMULATOR / DASHBOARD
   =================================== */
.drilling-simulator {
    background: var(--primary-dark);
}

.dashboard {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 48px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
}

.status-light.active {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--success);
}

.dashboard-time {
    margin-left: auto;
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--accent);
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* Gauges */
.gauge-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.gauge {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.gauge svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 6;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.gauge-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.gauge-unit {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-display);
}

/* Gas Meter */
.gas-card {
    position: relative;
}

.gas-meter {
    width: 100%;
    padding: 12px;
}

.gas-bars {
    display: flex;
    justify-content: center;
    gap: 3px;
    height: 60px;
    align-items: flex-end;
    margin-bottom: 8px;
}

.gas-bar {
    width: 12px;
    height: 10%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.gas-bar.active {
    background: var(--success);
}

.gas-bar.warning {
    background: var(--warning);
}

.gas-bar.danger {
    background: var(--danger);
    animation: gasFlash 0.4s ease-in-out infinite;
}

@keyframes gasFlash {
    50% {
        opacity: 0.5;
    }
}

.gas-value {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--success);
}

.gas-warning {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    animation: warningFlash 0.4s ease-in-out infinite;
}

body[dir="rtl"] .gas-warning {
    right: auto;
    left: 8px;
}

.gas-warning.show {
    display: block;
}

@keyframes warningFlash {
    50% {
        opacity: 0.7;
    }
}

/* Activity Log */
.activity-log {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    max-height: 120px;
    overflow-y: auto;
}

.log-header {
    font-family: var(--font-display);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
}

.log-time {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 10px;
    min-width: 60px;
}

.log-message {
    color: var(--text-muted);
}

.log-entry.success .log-message {
    color: var(--success);
}

.log-entry.warning .log-message {
    color: var(--warning);
}

.log-entry.danger .log-message {
    color: var(--danger);
}

.start-drilling {
    width: 100%;
    padding: 14px;
    font-size: 14px;
}

/* Job Cards */
.job-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.job-card {
    padding: 24px;
    text-align: center;
    position: relative;
}

.job-card::before {
    content: attr(data-step);
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

body[dir="rtl"] .job-card::before {
    right: auto;
    left: 12px;
}

.job-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.job-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.job-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===================================
   CORE SAMPLES
   =================================== */
.core-samples {
    background: var(--primary);
}

.core-viewer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.core-column {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.core-sample {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    border-radius: 10px;
    min-width: 160px;
    flex: 1;
    max-width: 200px;
}

.core-sample:hover {
    transform: scale(1.02);
}

.core-sample.active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.core-texture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

body[dir="rtl"] .core-texture {
    margin-right: 0;
    margin-left: 12px;
}

.core-texture.topsoil {
    background: repeating-linear-gradient(45deg, #44403c, #44403c 4px, #292524 4px, #292524 8px);
}

.core-texture.sandstone {
    background: radial-gradient(circle at 30% 30%, #d6d3d1 2px, transparent 2px),
        radial-gradient(circle at 70% 60%, #d6d3d1 2px, transparent 2px),
        #78716c;
    background-size: 12px 12px;
}

.core-texture.shale {
    background: repeating-linear-gradient(0deg, var(--shale-gray), var(--shale-gray) 2px, #3f3f46 2px, #3f3f46 4px);
}

.core-texture.limestone {
    background: var(--limestone-cream);
}

.core-texture.reservoir {
    background: var(--oil-black);
    position: relative;
    overflow: hidden;
}

.core-texture.reservoir::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 35%, var(--accent) 2px, transparent 2px),
        radial-gradient(circle at 65% 65%, var(--accent) 2px, transparent 2px);
    animation: oilShimmer 1.5s ease-in-out infinite;
}

@keyframes oilShimmer {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.core-sample[data-layer="topsoil"] {
    background: #44403c;
}

.core-sample[data-layer="sandstone"] {
    background: #78716c;
}

.core-sample[data-layer="shale"] {
    background: var(--shale-gray);
}

.core-sample[data-layer="limestone"] {
    background: #a8a29e;
    color: var(--primary);
}

.core-sample[data-layer="reservoir"] {
    background: var(--oil-black);
}

.core-info h4 {
    font-size: 13px;
    margin-bottom: 2px;
}

.core-info p {
    font-size: 11px;
    opacity: 0.8;
}

.core-sample.oil-bearing {
    position: relative;
}

.oil-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 700;
    animation: indicatorPulse 1.2s ease-in-out infinite;
}

body[dir="rtl"] .oil-indicator {
    right: auto;
    left: 8px;
}

@keyframes indicatorPulse {

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

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

.core-description {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
}

.description-title {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--accent);
}

.description-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===================================
   EXPERIENCE - DEPTH TIMELINE
   =================================== */
.experience {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

/* Depth scale background */
.experience::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background:
        repeating-linear-gradient(180deg,
            rgba(249, 115, 22, 0.1) 0px,
            rgba(249, 115, 22, 0.1) 1px,
            transparent 1px,
            transparent 100px);
    opacity: 0.5;
}

.depth-timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 80px;
}

body[dir="rtl"] .depth-timeline {
    padding-left: 0;
    padding-right: 80px;
}

/* Enhanced Wellbore with rock layers */
.wellbore {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 24px;
    border-radius: 12px;
    overflow: hidden;
}

body[dir="rtl"] .wellbore {
    left: auto;
    right: 24px;
}

/* Steel casing with shine */
.casing {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            #3a3a3a 0%,
            #5a5a5a 20%,
            #7a7a7a 50%,
            #5a5a5a 80%,
            #3a3a3a 100%);
    border-radius: 12px;
    box-shadow:
        inset 2px 0 4px rgba(255, 255, 255, 0.1),
        inset -2px 0 4px rgba(0, 0, 0, 0.3);
}

/* Drilling fluid animation inside casing */
.casing::before {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    top: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            var(--rock-brown) 0%,
            var(--sand-yellow) 25%,
            var(--shale-gray) 50%,
            var(--limestone-cream) 75%,
            var(--oil-black) 100%);
    opacity: 0.6;
    animation: drillingFluid 4s ease-in-out infinite;
}

@keyframes drillingFluid {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Drilling progress indicator */
.casing::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    animation: drillProgress 3s ease-in-out infinite;
}

@keyframes drillProgress {
    0% {
        top: 0%;
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0.3;
    }
}

/* Depth scale markers */
.depth-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background:
        repeating-linear-gradient(180deg,
            transparent 0px,
            transparent 98px,
            var(--accent) 98px,
            var(--accent) 100px);
    opacity: 0.3;
}

body[dir="rtl"] .depth-timeline::before {
    left: auto;
    right: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-marker {
    position: absolute;
    left: -44px;
    top: 24px;
    width: 16px;
    height: 16px;
    background: var(--shale-gray);
    border: 3px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
}

body[dir="rtl"] .timeline-marker {
    left: auto;
    right: -44px;
}

.timeline-marker.current {
    background: var(--accent);
}

.timeline-marker.edu {
    background: var(--secondary);
    border-color: var(--secondary);
}

.marker-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: markerPulse 2s ease-out infinite;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.timeline-content {
    padding: 20px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-date {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.depth-badge {
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 10px;
    font-family: var(--font-display);
    color: var(--text-dim);
}

.timeline-title {
    font-size: 18px;
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.timeline-list {
    list-style: none;
}

.timeline-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

body[dir="rtl"] .timeline-list li {
    padding-left: 0;
    padding-right: 16px;
}

.timeline-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 10px;
}

body[dir="rtl"] .timeline-list li::before {
    left: auto;
    right: 0;
    content: '◂';
}

.education-card {
    border-color: var(--secondary);
}

.edu-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.edu-badge {
    background: var(--secondary);
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
}

.oil-reservoir-marker {
    text-align: center;
    padding: 24px;
    position: relative;
}

.reservoir-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.25), transparent 70%);
    border-radius: 50%;
    animation: reservoirGlow 2.5s ease-in-out infinite;
}

@keyframes reservoirGlow {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.7;
    }
}

.oil-reservoir-marker span {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 1.5px;
}

/* ===================================
   SKILLS DASHBOARD
   =================================== */
.skills {
    background: var(--primary);
}

.skills-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.instrument-panel,
.pressure-panel,
.languages-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
}

.panel-title {
    font-size: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-note {
    font-size: 11px;
    color: var(--secondary);
    margin-top: -12px;
    margin-bottom: 16px;
    font-style: italic;
}

/* Dial Instruments */
.instruments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 20px;
}

.instrument {
    text-align: center;
}

.dial {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(from 135deg, rgba(255, 255, 255, 0.08) 0deg, rgba(255, 255, 255, 0.08) 270deg, transparent 270deg);
    position: relative;
    margin: 0 auto 12px;
    border: 2px solid var(--glass-border);
}

.dial-fill {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: conic-gradient(from 135deg, var(--accent) 0deg, var(--accent) 0deg, transparent 0deg, transparent 270deg);
    transition: background 0.8s ease;
}

.dial-needle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 3px;
    height: 28px;
    background: linear-gradient(to top, var(--danger), #ff7b7b);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-135deg);
    border-radius: 2px;
    transition: transform 0.8s ease;
    z-index: 2;
}

.dial::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--accent);
    z-index: 3;
}

.instrument-name {
    font-size: 11px;
    color: var(--text-muted);
}

/* Pressure Gauges */
.pressure-gauges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.pressure-gauge {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.pressure-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--accent-dark), var(--accent));
    transition: height 1.2s ease;
    opacity: 0.25;
}

.pressure-gauge span {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 600;
}

/* Language Bars */
.language-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.lang-name {
    min-width: 140px;
    font-size: 13px;
}

.lang-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    min-width: 100px;
}

.lang-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    border-radius: 8px;
    transition: width 1.2s ease;
}

/* Certifications Carousel */
.certifications {
    margin-top: 24px;
}

.certs-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
}

.certs-track {
    display: flex;
    gap: 16px;
    animation: scrollCerts 25s linear infinite;
    width: max-content;
}

@keyframes scrollCerts {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.cert-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 150px;
    transition: all var(--transition-normal);
}

.cert-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.cert-icon {
    font-size: 24px;
}

.cert-name {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.cert-date {
    font-size: 10px;
    color: var(--text-dim);
}

/* ===================================
   CONTACT
   =================================== */
.contact {
    background: var(--primary-dark);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.contact-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.contact-card h3 {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card p {
    font-size: 14px;
    color: var(--text-light);
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-rig {
    width: 32px;
    height: 40px;
    position: relative;
}

.mini-derrick {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 32px solid var(--accent);
    opacity: 0.4;
}

.footer-text {
    font-size: 13px;
    color: var(--text-dim);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablets */
@media (max-width: 992px) {
    :root {
        --section-padding: 60px 0;
    }

    .drilling-rig {
        width: 180px;
        right: 4%;
        opacity: 0.6;
    }

    .derrick {
        width: 50px;
        height: 140px;
    }

    .derrick-frame {
        border-left: 22px solid transparent;
        border-right: 22px solid transparent;
        border-bottom: 130px solid var(--accent);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --section-padding: 50px 0;
        --container-padding: 16px;
    }

    /* Navigation */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        inset: 0;
        background: var(--primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        font-size: 18px;
        color: var(--text-light);
    }

    /* Hero */
    .drilling-rig {
        display: none;
    }

    .hero {
        padding-top: 80px;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    body[dir="rtl"] .hero-content {
        margin: 0 auto;
    }

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

    .depth-counter {
        position: static;
        text-align: center;
        margin-top: 24px;
    }

    .scroll-indicator {
        bottom: 16px;
    }

    /* Dashboard */
    .dashboard {
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .gauge {
        width: 60px;
        height: 60px;
    }

    .gauge-value {
        font-size: 14px;
    }

    .gauge-label {
        font-size: 10px;
    }

    .gas-bars {
        height: 50px;
    }

    .gas-bar {
        width: 10px;
    }

    .start-drilling {
        font-size: 13px;
        padding: 12px;
    }

    /* Job Cards */
    .job-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .job-card {
        padding: 20px;
    }

    .job-icon {
        font-size: 32px;
    }

    /* Core Samples */
    .core-sample {
        min-width: 140px;
        padding: 10px 12px;
    }

    .core-texture {
        width: 32px;
        height: 32px;
    }

    .core-info h4 {
        font-size: 12px;
    }

    .core-info p {
        font-size: 10px;
    }

    /* Timeline */
    .depth-timeline {
        padding-left: 48px;
    }

    body[dir="rtl"] .depth-timeline {
        padding-left: 0;
        padding-right: 48px;
    }

    .wellbore {
        left: 16px;
        width: 12px;
    }

    body[dir="rtl"] .wellbore {
        left: auto;
        right: 16px;
    }

    .timeline-marker {
        left: -36px;
        width: 14px;
        height: 14px;
    }

    body[dir="rtl"] .timeline-marker {
        left: auto;
        right: -36px;
    }

    .timeline-content {
        padding: 16px;
    }

    .timeline-title {
        font-size: 16px;
    }

    /* Skills */
    .instruments-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .dial {
        width: 60px;
        height: 60px;
    }

    .dial-needle {
        height: 22px;
    }

    .instrument-name {
        font-size: 10px;
    }

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

    .pressure-gauge {
        padding: 12px;
    }

    .pressure-gauge span {
        font-size: 12px;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-card {
        padding: 20px 16px;
    }

    .contact-icon {
        font-size: 28px;
    }

    /* Certifications */
    .cert-card {
        min-width: 130px;
        padding: 12px 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --section-padding: 40px 0;
    }

    .lang-toggle {
        top: 12px;
        right: 12px;
        padding: 8px 16px;
        font-size: 12px;
    }

    body[dir="rtl"] .lang-toggle {
        right: auto;
        left: 12px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .hero-description {
        font-size: 14px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 260px;
    }

    .section-title {
        font-size: 22px;
    }

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

    .gauge-card {
        padding: 12px;
    }

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

    .pressure-gauges {
        grid-template-columns: 1fr;
    }

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

    .core-column {
        flex-direction: column;
    }

    .core-sample {
        max-width: 100%;
    }
}

/* Ensure touch-friendly tap targets */
@media (hover: none) {
    .btn {
        min-height: 48px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .core-sample {
        min-height: 60px;
    }

    .glass-card:hover {
        transform: none;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}