/* --- 1. DESIGN SYSTEM & INITIALIZATION --- */

:root {
    /* Fonts */
    --font-en: 'Outfit', sans-serif;
    --font-fa: 'Vazirmatn', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;

    /* Transition Speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Z-Index Hierarchy */
    --z-background: -10;
    --z-content: 1;
    --z-header: 100;
    --z-overlay: 1000;
}

/* Dark Mode Variables (Default) */
body.dark-mode {
    --bg-color: #0b0f19;
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #060913 100%);
    --bg-canvas: rgba(11, 15, 25, 0.9);
    --card-bg: rgba(17, 24, 39, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: rgba(0, 0, 0, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-accent: #00f2fe; /* Cyan */
    --text-accent-secondary: #a855f7; /* Purple */
    --text-glow: rgba(0, 242, 254, 0.3);
    
    --btn-primary-bg: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --btn-primary-text: #060913;
    --btn-secondary-border: #374151;
    --btn-secondary-hover: rgba(255, 255, 255, 0.05);
    
    --header-bg: rgba(11, 15, 25, 0.7);
    --terminal-bg: #070a13;
    
    /* GitHub Calendar Grid colors - Dark */
    --git-cell-0: #161b22;
    --git-cell-1: #0e4429;
    --git-cell-2: #006d32;
    --git-cell-3: #26a641;
    --git-cell-4: #39d353;
}

/* Light Mode Variables */
body.light-mode {
    --bg-color: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #eef2ff 50%, #fdf2f8 100%);
    --bg-canvas: rgba(248, 250, 252, 0.85);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(15, 23, 42, 0.08);
    --card-shadow: rgba(15, 23, 42, 0.06);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: #4f46e5; /* Rich Indigo */
    --text-accent-secondary: #ea580c; /* Coral */
    --text-glow: rgba(79, 70, 229, 0.15);
    
    --btn-primary-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --btn-primary-text: #ffffff;
    --btn-secondary-border: #cbd5e1;
    --btn-secondary-hover: rgba(15, 23, 42, 0.05);
    
    --header-bg: rgba(241, 245, 249, 0.7);
    --terminal-bg: #1e293b;
    
    /* GitHub Calendar Grid colors - Light */
    --git-cell-0: #ebedf0;
    --git-cell-1: #9be9a8;
    --git-cell-2: #40c463;
    --git-cell-3: #30a14e;
    --git-cell-4: #216e39;
}

/* --- 2. GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-en);
    transition: background var(--transition-slow), color var(--transition-normal);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Persian Font Override when RTL */
html[dir="rtl"] body {
    font-family: var(--font-fa);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

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

section {
    padding: 6rem 0 3rem 0;
    position: relative;
    opacity: 1;
    transition: opacity var(--transition-slow);
}

.hidden {
    display: none !important;
}

/* Glassmorphism card utility */
.glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 var(--card-shadow);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* --- 3. TERMINAL LOADER --- */
#terminal-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #04060b;
    z-index: var(--z-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.loader-window {
    width: 100%;
    max-width: 650px;
    background-color: #070b13;
    border: 1px solid #1f2a44;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.loader-header {
    background-color: #0c1220;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #111a2e;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

html[dir="rtl"] .dot {
    margin-right: 0;
    margin-left: 6px;
}

.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #eab308; }
.dot.green { background-color: #22c55e; }

.loader-title {
    color: #4b5563;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-left: 12px;
}

html[dir="rtl"] .loader-title {
    margin-left: 0;
    margin-right: 12px;
}

.loader-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    color: #38bdf8; /* Soft blue log */
    font-size: 0.9rem;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.terminal-log {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    scroll-behavior: smooth;
}

.terminal-log::-webkit-scrollbar {
    width: 4px;
}

.terminal-log::-webkit-scrollbar-thumb {
    background-color: #1f2937;
    border-radius: 2px;
}

.log-line {
    line-height: 1.4;
    white-space: pre-wrap;
}

.log-success { color: #4ade80; }
.log-warn { color: #facc15; }
.log-info { color: #38bdf8; }
.log-accent { color: #c084fc; }

.loader-progress-container {
    border-top: 1px solid #111a2e;
    padding-top: 1rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #111827;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2fe, #a855f7);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* --- 4. HEADER & NAV NAVIGATION --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: var(--z-header);
    transition: background-color var(--transition-slow), border-color var(--transition-normal);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-family: var(--font-en);
}

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

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

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-accent);
    box-shadow: 0 0 8px var(--text-glow);
    transition: width var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.btn-control {
    background: none;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.btn-control:hover {
    color: var(--text-primary);
    border-color: var(--text-accent);
    background-color: var(--btn-secondary-hover);
}

/* Language toggle styling */
.language-toggle-wrapper button {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    gap: 4px;
}

.lang-text {
    opacity: 0.4;
    transition: opacity var(--transition-fast);
}

.lang-text.active {
    opacity: 1;
    color: var(--text-accent);
}

.lang-divider {
    color: var(--text-muted);
}

/* Theme Button Icons Toggle */
.theme-btn svg {
    width: 20px;
    height: 20px;
}

body.dark-mode .sun-icon { display: block; color: #facc15; }
body.dark-mode .moon-icon { display: none; }
body.light-mode .sun-icon { display: none; }
body.light-mode .moon-icon { display: block; color: #4f46e5; }

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

html[dir="rtl"] .mobile-nav-overlay {
    right: 0;
    left: auto;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.mobile-nav-overlay.active {
    transform: translateX(0);
}

html[dir="rtl"] .mobile-nav-overlay.active {
    transform: translateX(0);
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.mobile-nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 700;
    transition: color var(--transition-fast);
}

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

/* --- 5. HERO SECTION --- */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

html[dir="rtl"] .hero-info {
    align-items: flex-start;
}

.badge-glow {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-accent);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 10px var(--text-glow);
    animation: pulseGlow 2.5s infinite alternate;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    display: block;
}

.text-highlight {
    background: linear-gradient(135deg, var(--text-accent) 0%, var(--text-accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px var(--text-glow));
    font-weight: 800;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.hero-subtitle .prefix {
    color: var(--text-accent);
    font-weight: 700;
}

.typewriter-cursor::after {
    content: '_';
    animation: blinkCursor 0.8s infinite step-end;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 580px;
}

.hero-cta-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    text-decoration: none;
    font-weight: 700;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 242, 254, 0.4);
}

.btn-secondary {
    border: 1px solid var(--btn-secondary-border);
    color: var(--text-primary);
    background-color: transparent;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    background-color: var(--card-bg);
    transition: color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.social-icon:hover {
    color: var(--text-accent);
    border-color: var(--text-accent);
    transform: translateY(-3px);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

/* Hologram Visual Wrapper */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hologram-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 20px;
    background-color: rgba(17, 24, 39, 0.4);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.05);
    overflow: hidden;
    cursor: pointer;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.hologram-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hologram-scanner {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 10%;
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 254, 0.4), transparent);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hologram-scanner.scanning {
    opacity: 1;
    animation: scannerScan 1.5s 2 alternate ease-in-out; /* sweeps down and up once */
}

/* Face ID Checkmark Styling */
.face-id-checkmark-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.face-id-checkmark-container.success {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.face-id-checkmark-svg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981; /* iOS Success Green */
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981, 0 0 25px rgba(16, 185, 129, 0.5);
    animation: faceIdFill .4s ease-in-out .4s forwards, faceIdScale .3s ease-in-out .9s both;
}

.face-id-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-linecap: round;
    stroke: #10b981;
    fill: rgba(7, 10, 19, 0.85); /* semi-transparent backup */
    animation: faceIdStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.face-id-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-linecap: round;
    stroke-width: 4;
    animation: faceIdStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

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

@keyframes faceIdFill {
    100% {
        box-shadow: inset 0px 0px 0px 40px rgba(16, 185, 129, 0.1), 0 0 30px rgba(16, 185, 129, 0.6);
    }
}

@keyframes faceIdScale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.15, 1.15, 1);
    }
}

.avatar-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.2)) saturate(1.1);
    transition: filter var(--transition-normal);
}

.hologram-wrapper:hover .avatar-img {
    filter: drop-shadow(0 0 20px rgba(0, 242, 254, 0.5)) saturate(1.2);
}

/* Sci-fi corners design element */
.hologram-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--text-accent);
    border-style: solid;
    z-index: 3;
}

.hologram-corner.top-left { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.hologram-corner.top-right { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.hologram-corner.bottom-left { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.hologram-corner.bottom-right { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }

.hologram-specs {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background-color: rgba(7, 10, 19, 0.85);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    z-index: 3;
    pointer-events: none;
}

/* --- 6. ABOUT SECTION --- */
.section-header {
    margin-bottom: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    position: relative;
    padding-bottom: 0.75rem;
    text-align: center;
}

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

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
}

.about-card {
    padding: 2.5rem;
}

.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-accent);
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-accent), var(--text-accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    font-family: var(--font-en);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- 7. PLAYABLE CONSOLE SECTION --- */
.terminal-shell {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    background-color: var(--terminal-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px var(--card-shadow);
}

.terminal-shell-header {
    background-color: rgba(0, 0, 0, 0.25);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    position: relative;
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-tab {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-shell-body {
    padding: 1.5rem;
    height: 380px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    scroll-behavior: smooth;
    color: var(--text-primary);
}

.terminal-shell-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-shell-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.shell-output-line {
    white-space: pre-wrap;
    line-height: 1.5;
}

.shell-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.shell-prompt {
    color: #4ade80; /* bright green username */
    white-space: nowrap;
}

.input-container {
    display: flex;
    flex-grow: 1;
    position: relative;
}

#terminal-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 100%;
    caret-color: transparent; /* custom cursor */
}

#terminal-cursor {
    position: absolute;
    left: 0;
    color: var(--text-accent);
    font-weight: bold;
    pointer-events: none;
    animation: blinkCursor 0.8s infinite step-end;
}

.text-accent { color: var(--text-accent); }
.text-secondary-accent { color: var(--text-accent-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: #4ade80; }
.text-warn { color: #facc15; }
.text-error { color: #f87171; }

.terminal-shell-footer {
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--card-border);
}

.quick-commands-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.quick-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

html[dir="rtl"] .quick-label {
    margin-right: 0;
    margin-left: 0.5rem;
}

.btn-quick-cmd {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-quick-cmd:hover {
    background-color: rgba(0, 242, 254, 0.1);
    border-color: var(--text-accent);
}

/* --- 8. SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.skill-card:hover {
    border-color: var(--text-accent);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.15);
    transform: translateY(-5px);
}

.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background-color: rgba(0, 242, 254, 0.05);
    color: var(--text-accent);
    border: 1px solid rgba(0, 242, 254, 0.15);
    margin-bottom: 1.5rem;
}

.skill-card:nth-child(even) .skill-icon {
    background-color: rgba(168, 85, 247, 0.05);
    color: var(--text-accent-secondary);
    border-color: rgba(168, 85, 247, 0.15);
}

.skill-icon svg {
    width: 24px;
    height: 24px;
}

.skill-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.skill-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* --- 9. GITHUB STATS & CALENDAR --- */
.github-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.github-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.github-profile-brief {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.github-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--text-accent);
}

.github-profile-brief h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.github-username-link {
    color: var(--text-accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.github-username-link:hover {
    text-decoration: underline;
}

.github-numbers {
    display: flex;
    gap: 1.5rem;
}

.stat-num-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    min-width: 110px;
}

.stat-num-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-num-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Calendar structure */
.github-calendar-wrapper {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.calendar-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.calendar-scroll-box {
    overflow-x: auto;
    width: 100%;
}

.calendar-scroll-box::-webkit-scrollbar {
    height: 6px;
}

.calendar-scroll-box::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.calendar-graph-container {
    display: inline-grid;
    grid-template-columns: auto repeat(53, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    padding-bottom: 0.5rem;
    min-width: 780px; /* Force minimum width to prevent collapse */
}

.calendar-day-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background-color: var(--git-cell-0);
    position: relative;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.calendar-day-cell:hover {
    transform: scale(1.3);
    z-index: 10;
}

/* Levels color map */
.calendar-day-cell.level-0 { background-color: var(--git-cell-0); }
.calendar-day-cell.level-1 { background-color: var(--git-cell-1); }
.calendar-day-cell.level-2 { background-color: var(--git-cell-2); }
.calendar-day-cell.level-3 { background-color: var(--git-cell-3); }
.calendar-day-cell.level-4 { background-color: var(--git-cell-4); }

.calendar-legend {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-box {
    width: 11px;
    height: 11px;
    border-radius: 2px;
}

.legend-box.level-0 { background-color: var(--git-cell-0); }
.legend-box.level-1 { background-color: var(--git-cell-1); }
.legend-box.level-2 { background-color: var(--git-cell-2); }
.legend-box.level-3 { background-color: var(--git-cell-3); }
.legend-box.level-4 { background-color: var(--git-cell-4); }

/* Custom calendar cell tooltip */
.cell-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: #070a13;
    border: 1px solid #1e293b;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    color: #ffffff;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.calendar-day-cell:hover .cell-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Repositories grid */
.github-repos-container {
    margin-top: 0.5rem;
}

.repos-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.repos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.repo-card {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.repo-card:hover {
    border-color: var(--text-accent);
    background-color: rgba(0, 242, 254, 0.02);
    transform: translateY(-2px);
}

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

.repo-link-title {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.repo-link-title:hover {
    color: var(--text-accent);
}

.repo-visibility {
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--card-border);
    padding: 0.15rem 0.4rem;
    border-radius: 99px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.repo-desc-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.repo-footer {
    display: flex;
    gap: 1.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.repo-lang {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.repo-loading-card {
    grid-column: 1 / -1;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px dashed var(--card-border);
    border-radius: 10px;
}

/* --- 10. CONTACT SECTION & FOOTER --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
}

.contact-form-container {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--text-accent);
    box-shadow: 0 0 10px var(--text-glow);
}

/* RTL overrides for form inputs */
html[dir="rtl"] .form-group input, html[dir="rtl"] .form-group textarea {
    font-family: var(--font-fa);
}

.btn-submit {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn-glow-line {
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    animation: flowLine 3s infinite linear;
}

.contact-info-container {
    display: flex;
    flex-direction: column;
}

.info-card {
    padding: 2.5rem;
    height: 100%;
}

.info-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-accent);
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.info-details-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    color: var(--text-accent);
    background-color: rgba(0, 242, 254, 0.03);
}

.detail-icon svg {
    width: 20px;
    height: 20px;
}

.detail-item h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.detail-item span, .detail-item a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.detail-item a:hover {
    color: var(--text-accent);
    text-decoration: underline;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--card-border);
    padding: 2rem 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

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

/* --- 11. KEYFRAME ANIMATIONS --- */
@keyframes scannerScan {
    0% { top: 0%; }
    50% { top: 90%; }
    100% { top: 0%; }
}

@keyframes blinkCursor {
    from, to { color: transparent; }
    50% { color: inherit; }
}

@keyframes pulseGlow {
    from {
        box-shadow: inset 0 0 10px var(--text-glow), 0 0 5px rgba(0, 242, 254, 0.1);
    }
    to {
        box-shadow: inset 0 0 15px var(--text-glow), 0 0 15px rgba(0, 242, 254, 0.3);
    }
}

@keyframes flowLine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* --- 12. RESPONSIVENESS MEDIA QUERIES --- */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
        text-align: center;
    }
    
    .hero-info {
        align-items: center;
    }
    
    html[dir="rtl"] .hero-info {
        align-items: center;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .repos-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .stat-box {
        padding: 1rem;
    }
    
    .stat-num {
        font-size: 2rem;
    }
    
    .terminal-shell-body {
        height: 300px;
    }
    
    .github-stats-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .github-numbers {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-num-card {
        flex-grow: 1;
        padding: 0.5rem;
        min-width: 80px;
    }
}

/* RTL layout fixes */
html[dir="rtl"] .loader-body,
html[dir="rtl"] .terminal-shell-body,
html[dir="rtl"] #terminal-input {
    direction: ltr; /* keep CLI inputs LTR code structure */
}

html[dir="rtl"] #terminal-cursor {
    left: auto;
    right: 0;
}

/* Language Switching Smooth Transition Animation */
#app-content {
    opacity: 1;
    filter: blur(0);
    transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1), 
                filter 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

#app-content.lang-switching {
    opacity: 0.5;
    filter: blur(12px);
}

/* --- 13. GITHUB METRICS & FEATURED PROJECTS STYLES --- */
.github-metrics-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    margin: 3rem 0;
    box-shadow: 0 1px 5px var(--text-glow);
}

.github-metrics-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.metrics-languages-card, .metrics-stats-card {
    display: flex;
    flex-direction: column;
}

.metrics-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-left: 12px;
}

html[dir="rtl"] .metrics-title {
    padding-left: 0;
    padding-right: 12px;
}

.metrics-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--text-accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--text-glow);
}

html[dir="rtl"] .metrics-title::before {
    left: auto;
    right: 0;
}

.languages-bar-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.lang-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lang-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

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

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

.lang-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
}

.lang-bar-fill {
    height: 100%;
    border-radius: 99px;
    box-shadow: 0 0 6px var(--text-glow);
}

.lang-bar-fill.js {
    background: linear-gradient(90deg, #facc15, #eab308);
}

.lang-bar-fill.php {
    background: linear-gradient(90deg, #8892bf, #4f5b93);
}

.lang-bar-fill.ts {
    background: linear-gradient(90deg, #3178c6, #235a97);
}

.lang-bar-fill.web {
    background: linear-gradient(90deg, #f06529, #e34c26);
}

.lang-bar-fill.py {
    background: linear-gradient(90deg, #3572a5, #2b5b84);
}

.dev-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.dev-stat-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.dev-stat-box:hover {
    transform: translateY(-2px);
    border-color: var(--text-accent);
}

.dev-stat-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-accent);
    text-shadow: 0 0 8px var(--text-glow);
}

.dev-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.featured-projects-section {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.featured-repos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.featured-repo-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.featured-repo-card:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--text-accent);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.1);
}

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

.repo-badge {
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 0.2rem 0.6rem;
    text-transform: uppercase;
}

.repo-badge.private {
    background-color: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.repo-lang {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.repo-lang.js { color: #facc15; }
.repo-lang.php { color: #8892bf; }
.repo-lang.ts { color: #3178c6; }

.repo-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.repo-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

.repo-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    padding-top: 0.85rem;
    margin-top: 0.25rem;
}

@media (max-width: 968px) {
    .github-metrics-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .featured-repos-grid {
        grid-template-columns: 1fr;
    }
    
    .dev-stats-grid {
        grid-template-columns: 1fr;
    }
}
