/* ==========================================================================
   Design System & Theme Variables - Masoud Khodadadi Portfolio
   ========================================================================== */

/* Font Imports (Vazirmatn CDN & Google Fonts) */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    /* Font Families */
    --font-fa: 'Vazirmatn', 'Vazir', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Light Theme Palette */
    --bg-dark: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.92);
    --bg-surface-hover: rgba(241, 245, 249, 0.95);
    --text-main: #0f172a;
    --text-muted: #334155;
    --border-glass: rgba(15, 23, 42, 0.15);
    --border-glass-subtle: rgba(15, 23, 42, 0.08);

    /* Brand Accents */
    --accent-indigo: #4f46e5;
    --accent-blue: #2563eb;
    --accent-cyan: #0284c7;
    --accent-purple: #7c3aed;

    /* Shadows */
    --shadow-glow-indigo: 0 0 25px -5px rgba(79, 70, 229, 0.35);
    --shadow-glow-cyan: 0 0 25px -5px rgba(2, 132, 199, 0.35);
}

html.dark {
    /* Dark Cyber Glass Theme Palette */
    --bg-dark: #080c14;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-surface-hover: rgba(30, 41, 59, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glass-subtle: rgba(255, 255, 255, 0.06);

    --shadow-glow-indigo: 0 0 30px -5px rgba(99, 102, 241, 0.5);
    --shadow-glow-cyan: 0 0 30px -5px rgba(56, 189, 248, 0.5);
}

/* Smooth Scrolling Setup */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

/* Enforce Vazirmatn Font Across ALL UI Elements */
*, ::before, ::after, body, button, input, textarea, select, h1, h2, h3, h4, h5, h6, p, span, a, div, li, label, strong, b {
    font-family: 'Vazirmatn', 'Vazir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Monospace font strictly for code & terminal */
.font-mono, code, pre, kbd, .font-mono *, [id^="terminal"], .dir-ltr {
    font-family: 'JetBrains Mono', monospace !important;
}

/* Base Body Styles */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   Glassmorphism & Utility Components
   ========================================================================== */

.glass-nav {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
}

html.dark .glass-card {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

.glass-button {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-button:hover {
    background: var(--bg-surface-hover);
}

.border-glass {
    border-color: var(--border-glass);
}

.border-glass-subtle {
    border-color: var(--border-glass-subtle);
}

.bg-surface {
    background-color: var(--bg-surface);
}

.text-main {
    color: var(--text-main);
}

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

.shadow-glow-indigo {
    box-shadow: var(--shadow-glow-indigo);
}

.shadow-glow-cyan {
    box-shadow: var(--shadow-glow-cyan);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

/* Custom Form Input Styling for Light & Dark Mode */
.custom-input {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    transition: all 0.25s ease;
}

html.dark .custom-input {
    background-color: rgba(15, 23, 42, 0.85) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

html.dark .custom-input::placeholder {
    color: #64748b !important;
}

html.light .custom-input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.light .custom-input::placeholder {
    color: #64748b !important;
}

.custom-input:focus {
    outline: none !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important;
}

/* High Contrast Tech Pill Badge (Light & Dark Theme Compatible) */
.tech-pill {
    transition: all 0.2s ease;
}

html.light .tech-pill {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    font-weight: 600;
}

html.dark .tech-pill {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Timeline High-Contrast Subtitle Text */
html.light .timeline-subtitle {
    color: #4338ca !important;
    font-weight: 700 !important;
}

html.dark .timeline-subtitle {
    color: #a5b4fc !important;
    font-weight: 600;
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html.dark .gradient-text {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Ambient Background Lights */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    z-index: -1;
    animation: pulse-glow 8s ease-in-out infinite alternate;
}

.glow-1 {
    top: 10%;
    right: 15%;
    width: 450px;
    height: 450px;
    background: #6366f1;
}

.glow-2 {
    top: 40%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: #06b6d4;
}

.glow-3 {
    bottom: 15%;
    right: 25%;
    width: 400px;
    height: 400px;
    background: #ec4899;
}

@keyframes pulse-glow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.15; }
    100% { transform: scale(1.15) translate(20px, -20px); opacity: 0.25; }
}

/* Cursor Blink Animation */
.cursor-blink {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: #38bdf8;
    margin-right: 4px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   Smooth Navigation & Hover Micro-Animations
   ========================================================================== */

.nav-link {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 50%;
    transform: translateX(50%) scaleX(0);
    width: 50%;
    height: 2.5px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.active-nav {
    color: #2563eb !important;
    font-weight: 700;
    background-color: rgba(37, 99, 235, 0.12);
}

html.dark .nav-link.active-nav {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.12);
}

.nav-link.active-nav::after, .nav-link:hover::after {
    transform: translateX(50%) scaleX(1);
}

/* Hover States for Tabs in Light & Dark Mode */
html.light .skill-tab:not(.active):hover, html.light .project-filter:not(.active):hover {
    color: #4f46e5 !important;
    background-color: rgba(79, 70, 229, 0.1) !important;
}

html.dark .skill-tab:not(.active):hover, html.dark .project-filter:not(.active):hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Active Skill & Project Filter Styling */
.skill-tab.active, .project-filter.active {
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

/* Mobile Menu Animation */
#mobileMenu {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll Reveal Animation Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Direction Fixes for LTR Code Elements */
.dir-ltr {
    direction: ltr !important;
}

/* Transitions & Animations */
.animate-fade-in {
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness for Experience Timeline */
@media (max-width: 767px) {
    .timeline-line::before {
        right: 1.25rem !important;
        left: auto !important;
        transform: none !important;
    }
    .timeline-node-circle {
        right: 1.25rem !important;
        left: auto !important;
        transform: translateX(50%) !important;
    }
    .timeline-item-wrapper {
        padding-right: 2.75rem !important;
        padding-left: 0 !important;
        width: 100% !important;
        text-align: right !important;
    }
}

/* Interactive Cursor Pointers */
button, a, input, textarea {
    cursor: pointer;
}

/* Focus Visible Accessibility Outline */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}
