/* Modern Professional Portfolio - Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Modern Premium Dark (Slate & Indigo) */
    --bg-body: #0B1121;
    --bg-sidebar: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.8);

    --text-primary: #FFFFFF;
    --text-secondary: #C1CFE0;
    --text-accent: #22D3EE;
    --text-glow: rgba(56, 189, 248, 0.5);

    --border-color: rgba(255, 255, 255, 0.1);

    --gradient-primary: linear-gradient(135deg, #0EA5E9 0%, #6366F1 50%, #EC4899 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);

    --sidebar-width: 300px;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --backdrop-blur: blur(12px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-accent);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
}

.loader-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--text-accent);
    border-bottom-color: #6366F1;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.loader-circle-inner {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-left-color: #EC4899;
    border-right-color: var(--text-accent);
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% {
        opacity: 0.7;
        text-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(34, 211, 238, 0.8), 0 0 30px rgba(99, 102, 241, 0.6);
        color: var(--text-accent);
    }
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    color: var(--text-secondary);
    font-family: 'Figtree', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: var(--glass-border);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1000;
    transition: var(--transition-smooth);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

.profile-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 3px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.profile-img:hover {
    border-color: var(--text-accent);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

.profile-name {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-link i {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
    color: var(--text-accent);
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.1);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), transparent);
    border-left: 3px solid var(--text-accent);
    border-radius: 4px 12px 12px 4px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
}

.social-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.social-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    border-color: transparent;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    background-color: var(--bg-body);
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    filter: blur(80px);
    z-index: 0;
    animation: pulseGlow 8s infinite alternate;
}

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

    100% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-accent);
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: inline-block;
    padding: 0.45rem 1rem;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.hero-title {
    font-size: 3.75rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -2px;
    position: relative;
    z-index: 1;
}

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

/* Hero Buttons */
.hero-btns {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0;
}

.btn-primary-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 2rem;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    border: none;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.btn-primary-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.5);
    color: white;
}

.btn-outline-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 2rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--transition-smooth);
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.btn-outline-modern:hover {
    border-color: var(--text-accent);
    background-color: rgba(56, 189, 248, 0.1);
    color: white;
    transform: translateY(-3px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 3rem;
}

.stat-item {
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-5px);
}

.stat-item h3 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.stat-item p {
    font-size: 0.8rem;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Sections */
.section-padding {
    padding: 7rem 5rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    font-weight: 800;
    letter-spacing: -1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 70px;
    height: 5px;
    background: var(--gradient-primary);
    border-radius: 3px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* About */
.about-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.about-info-item {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
    backdrop-filter: blur(5px);
}

.about-info-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--text-accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.about-icon {
    width: 45px;
    height: 45px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--text-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1rem;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.about-info-item:hover .about-icon {
    background: var(--text-accent);
    color: white;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.about-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    word-break: break-all;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: 0.4s;
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-accent);
    transition: 0.4s;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
    color: #fff;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

.skill-card h4 {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    z-index: 1;
}

/* Portfolio / Services Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Services (What I Do) cards */
.skill-card[style*="align-items: flex-start"] {
    text-align: left;
}

.portfolio-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-card:hover {
    transform: translateY(-12px);
    border-color: var(--text-accent);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.1);
}

.portfolio-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.portfolio-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    opacity: 0.6;
    transition: 0.4s;
}

.portfolio-card:hover .portfolio-img-wrapper::after {
    opacity: 0.3;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card:hover .portfolio-img {
    transform: scale(1.12);
}

.portfolio-content {
    padding: 1.75rem;
}

.portfolio-tag {
    font-size: 0.7rem;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50px;
    font-weight: 700;
}

.portfolio-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: 0.3s;
}

.portfolio-link i {
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

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

.portfolio-link:hover i {
    transform: translateX(6px);
    color: var(--text-accent);
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

/* Prevent grid children from overflowing on small screens */
.contact-grid>* {
    min-width: 0;
    width: 100%;
}

.contact-form {
    width: 100%;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 12px;
    transition: 0.3s;
}

.contact-info-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-accent);
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: 0.3s;
}

.contact-info-item:hover .contact-icon {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

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

.form-control-modern {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--text-accent);
    background-color: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.help-block.text-danger {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* =====================
   MOBILE RESPONSIVENESS
   ===================== */

/* Mobile toggle — hidden on desktop */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 991px) {
    .wrapper {
        flex-direction: column;
    }

    /* Slide-in sidebar */
    .sidebar {
        width: 270px;
        transform: translateX(-100%);
        border-right: none;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.4);
        z-index: 1001;
        justify-content: flex-start;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

    /* Toggle button */
    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1002;
        background: var(--gradient-primary);
        color: white;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 1.1rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    }

    .hero-section {
        padding: 6rem 1.75rem 3rem;
        text-align: center;
        flex-direction: column;
        justify-content: center;
    }

    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

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

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

    .stat-item h3 {
        font-size: 1.75rem;
    }

    .section-padding {
        padding: 4.5rem 1.75rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    /* Services & Portfolio — 1 column on tablet */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .stat-item h3 {
        font-size: 2rem;
    }

    .section-padding {
        padding: 3.5rem 1.25rem;
    }

    .btn-primary-modern,
    .btn-outline-modern {
        width: 100%;
        justify-content: center;
    }

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

    /* ---- Contact form fixes for small phones ---- */
    .contact-grid {
        gap: 2rem;
    }

    .contact-form {
        width: 100%;
        overflow: hidden;
    }

    .form-control-modern {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
        /* Ensure inputs never exceed viewport */
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact-info-item {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .contact-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
}