/* =============================================
    M. Dehghan — Personal Portfolio Styles
    Theme: Dark / Cyber Security
    ============================================= */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #6a6a80;
    --accent: #00f0ff;
    --accent-dim: rgba(0, 240, 255, 0.15);
    --accent-glow: rgba(0, 240, 255, 0.3);
    --green: #00ff88;
    --green-dim: rgba(0, 255, 136, 0.15);
    --purple: #a855f7;
    --red: #ff4444;
    --gradient: linear-gradient(135deg, #00f0ff, #a855f7);
    --gradient-text: linear-gradient(135deg, #00f0ff 0%, #a855f7 50%, #00ff88 100%);
    --border-color: rgba(255, 255, 255, 0.06);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --font-persian: 'Vazirmatn', 'Tahoma', sans-serif;
    --max-width: 1200px;
    --nav-height: 72px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) var(--bg-primary);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-glow); }

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

.section {
    padding: 100px 0;
}

/* ---------- Gradient Text ---------- */
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 60px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.7;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.05rem;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border-color);
    background: rgba(10, 10, 15, 0.95);
}

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

.logo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
    border-radius: 1px;
}

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

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

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 24px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
}

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

.lang-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.lang-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 0.75rem;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--nav-height);
}

/* Particles */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s infinite;
    box-shadow: 0 0 6px var(--accent-glow);
}

@keyframes particleFloat {
    0%   { opacity: 0; transform: translateY(100vh) scale(0); }
    20%  { opacity: 0.6; }
    80%  { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* Background glow */
.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.06), transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.05), transparent 70%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

/* Hero Profile Image */
.hero-image-wrapper {
    display: inline-block;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease 0.05s both;
}

.hero-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 20px var(--accent-dim);
    transition: var(--transition);
}

.hero-image-wrapper:hover .hero-image {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--accent-glow), inset 0 0 25px var(--accent-dim);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-typing-wrapper {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    min-height: 2em;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.typing-prefix {
    color: var(--text-secondary);
}

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

.typing-cursor {
    color: var(--accent);
    font-weight: 300;
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 36px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    animation: fadeInUp 0.6s ease 0.5s both;
}

.hero-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.hero-socials a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 0 20px var(--accent-glow);
}

.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    animation: bounceDown 2s infinite;
    z-index: 1;
}

.scroll-indicator i {
    font-size: 0.8rem;
}

@keyframes bounceDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ABOUT
   ============================================= */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.about-text strong {
    color: var(--text-primary);
}

.about-stats {
    display: flex;
    gap: 32px;
    margin-top: 32px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.about-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-card-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.about-card-inner:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
    transform: translateX(6px);
}

.about-card-inner i {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.about-card-inner h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.about-card-inner p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =============================================
   SKILLS
   ============================================= */
.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.skill-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category-title i {
    color: var(--accent);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 8px 18px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-dim);
}

/* =============================================
   EXPERIENCE / TIMELINE
   ============================================= */
.experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--purple), transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 48px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 6px;
    opacity: 0.8;
}

.timeline-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =============================================
   PROJECTS
   ============================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-card-header i {
    font-size: 1.8rem;
    color: var(--accent);
}

.project-links {
    display: flex;
    gap: 12px;
}

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

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

.project-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.project-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 18px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 4px 10px;
    border-radius: 4px;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-content {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

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

.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: left;
}

.contact-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.contact-card i {
    font-size: 1.2rem;
    color: var(--accent);
    width: 28px;
    text-align: center;
}

.contact-card span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-motto {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 968px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        justify-content: center;
    }

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

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        padding: 20px 0;
        transform: translateY(-120%);
        transition: var(--transition);
        opacity: 0;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-link {
        padding: 14px 0;
        font-size: 1rem;
    }

    .hamburger {
        display: flex;
    }

    .lang-switcher {
        margin-left: auto;
        margin-right: 16px;
    }

    html[dir="rtl"] .lang-switcher {
        margin-left: 16px;
        margin-right: auto;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

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

    .about-stats {
        flex-wrap: wrap;
        gap: 20px;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-image {
        width: 90px;
        height: 90px;
    }
}

/* =============================================
   RTL (Persian) Styles
   ============================================= */
html[dir="rtl"] body {
    font-family: var(--font-persian), var(--font-sans);
    direction: rtl;
}

html[dir="rtl"] .nav-links {
    direction: rtl;
}

html[dir="rtl"] .section-header {
    direction: rtl;
}

html[dir="rtl"] .hero-typing-wrapper {
    direction: rtl;
}

html[dir="rtl"] .about-card-inner:hover {
    transform: translateX(-6px);
}

html[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 32px;
}

html[dir="rtl"] .timeline::before {
    left: auto;
    right: 7px;
}

html[dir="rtl"] .timeline-dot {
    left: auto;
    right: -28px;
}

html[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: 24px;
}

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

html[dir="rtl"] .nav-links.open {
    direction: rtl;
}

html[dir="rtl"] .contact-card {
    text-align: right;
}

html[dir="rtl"] .project-links {
    direction: ltr;
}

/* =============================================
   REVEAL ON SCROLL
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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