/* =========================================
   AI MODERN DESIGN SYSTEM + THREE.JS
   Theme: Dark, Glassmorphism, Neon, 3D
   ========================================= */

:root {
    /* AI Developer Color Palette - Professional & Technical */
    --bg-dark: #0d1117;
    --bg-card: rgba(13, 17, 23, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.02);

    --primary: #58a6ff;        /* GitHub Blue */
    --secondary: #f85149;      /* Error Red */
    --accent: #a5a5a5;        /* Neutral Gray */
    --success: #3fb950;       /* Success Green */
    --warning: #d29922;       /* Warning Orange */
    
    --text-main: #f0f6fc;
    --text-light: #c9d1d9;
    --text-muted: #8b949e;
    --text-dim: #6e7681;

    --gradient-main: linear-gradient(135deg, var(--primary), var(--accent));
    --gradient-code: linear-gradient(135deg, #21262d, #161b22);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Space Mono', monospace;

    /* Spacing & Layout */
    --max-width: 1200px;
    --header-height: 80px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    /* Effects */
    --glass-blur: blur(16px);
    --glass-border: 1px solid rgba(240, 246, 252, 0.06);
    --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.1);
    --shadow-3d: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 16px rgba(88, 166, 255, 0.05);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Three.js Canvas Styling */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#three-canvas canvas {
    display: block;
}

/* Background Ambient Glow */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.2), transparent 60%);
    filter: blur(80px);
    z-index: -1;
    animation: ambient-pulse 10s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 242, 234, 0.15), transparent 60%);
    filter: blur(80px);
    z-index: -1;
    animation: ambient-pulse 10s infinite alternate-reverse;
}

@keyframes ambient-pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

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

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
}

/* Utility Classes */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-panel:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: var(--shadow-3d);
    border-color: rgba(0, 242, 234, 0.3);
}

.t-gradient {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =========================================
   COMPONENTS
   ========================================= */

/* Buttons with 3D Effects */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.2), 0 0 20px rgba(0, 242, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.btn-secondary:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 242, 234, 0.2);
}

/* =========================================
   LAYOUT SECTIONS
   ========================================= */

/* Header / Float Nav */
header {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 20px;
}

/* Navbar Centered Dock Style */
nav {
    max-width: fit-content;
    margin: 0 auto;
    padding: 12px 30px;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo h1 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.burger {
    display: none;
}

/* Hero Section with 3D Enhancements */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    perspective: 1000px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    transform-style: preserve-3d;
}

.hero-content {
    transform-style: preserve-3d;
    animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0px) rotateX(0deg); }
    50% { transform: translateY(-10px) rotateX(1deg); }
}

.hero-content h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content h2 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 500px;
    margin-bottom: 2.5rem;
    color: var(--text-light);
}

/* AI Developer 3D Profile Section */
.profile-3d-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.holographic-frame {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 8px;
    background: var(--gradient-code);
    border: 1px solid var(--primary);
    box-shadow: 
        0 0 20px rgba(88, 166, 255, 0.2),
        inset 0 0 20px rgba(88, 166, 255, 0.05);
    animation: terminalGlow 4s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes terminalGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(88, 166, 255, 0.2), inset 0 0 20px rgba(88, 166, 255, 0.05);
        border-color: var(--primary);
    }
    50% { 
        box-shadow: 0 0 30px rgba(88, 166, 255, 0.4), inset 0 0 30px rgba(88, 166, 255, 0.1);
        border-color: var(--success);
    }
}

.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(88, 166, 255, 0.03) 2px,
        rgba(88, 166, 255, 0.03) 4px
    );
    animation: dataFlow 3s linear infinite;
    z-index: 2;
}

@keyframes dataFlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.profile-img {
    width: 280px;
    height: 280px;
    border-radius: 6px;
    object-fit: cover;
    position: relative;
    z-index: 1;
    filter: brightness(0.9) contrast(1.1) grayscale(0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.profile-img:hover {
    filter: brightness(1.1) contrast(1.2) grayscale(0);
    transform: scale(1.02);
    border-color: var(--success);
}

.energy-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.ring {
    position: absolute;
    border: 1px solid;
    border-radius: 4px;
    animation: dataRing 4s ease-in-out infinite;
}

.ring-1 {
    width: 350px;
    height: 350px;
    border-color: rgba(88, 166, 255, 0.4);
    top: -175px;
    left: -175px;
    animation-delay: 0s;
}

.ring-2 {
    width: 380px;
    height: 380px;
    border-color: rgba(63, 185, 80, 0.3);
    top: -190px;
    left: -190px;
    animation-delay: 1.5s;
}

.ring-3 {
    width: 410px;
    height: 410px;
    border-color: rgba(165, 165, 165, 0.2);
    top: -205px;
    left: -205px;
    animation-delay: 3s;
}

@keyframes dataRing {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.float-element {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 1px;
    box-shadow: 0 0 8px var(--primary);
}

.element-1 {
    top: 20%;
    left: 10%;
    animation: codeFloat 6s ease-in-out infinite;
}

.element-2 {
    top: 70%;
    right: 15%;
    animation: codeFloat 8s ease-in-out infinite reverse;
    animation-delay: -2s;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.element-3 {
    bottom: 30%;
    left: 20%;
    animation: codeFloat 7s ease-in-out infinite;
    animation-delay: -4s;
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.element-4 {
    top: 40%;
    right: 25%;
    animation: codeFloat 9s ease-in-out infinite reverse;
    animation-delay: -1s;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

@keyframes codeFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(15px, -20px) scale(1.5);
    }
    50% {
        transform: translate(-10px, -15px) scale(0.8);
    }
    75% {
        transform: translate(20px, 8px) scale(1.2);
    }
}

/* Abstract AI Visual Sphere */
.ai-sphere {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 242, 234, 0.2), transparent 50%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 50px rgba(0, 242, 234, 0.1);
    animation: rotate-sphere 20s linear infinite;
}

.ai-sphere::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 0, 85, 0.3);
    animation: spin-rev 15s linear infinite;
}

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

@keyframes spin-rev {
    100% {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}


/* Section Header */
.section-header {
    margin-bottom: 4rem;
}

.section-label {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 3rem;
    line-height: 1.1;
}

/* Projects Section */
.projects {
    padding: 8rem 0;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 6rem;
    align-items: center;
    position: relative;
}

/* Alternate Layout so images switch sides */
.project-card:nth-child(even) {
    direction: rtl;
    /* simple hack to swap columns */
}

.project-card:nth-child(even) .project-content {
    direction: ltr;
    /* reset text direction */
}

.project-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.5s ease;
}

.project-preview:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.project-content {
    padding: 2rem;
}

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

.project-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Tech Badges (Redesigned) */
.tech-stack {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* Metrics Grid (Redesigned) */
.project-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.skill-card {
    background: var(--bg-glass);
    border: var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.3s ease;
}

.skill-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.skill-icon {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.skill-name {
    font-weight: 600;
}

/* Socials */
.social-links a {
    font-size: 1.5rem;
    margin-right: 1.5rem;
    color: var(--text-muted);
}

.social-links a:hover {
    color: var(--primary);
}


/* Responsive */
@media screen and (max-width: 968px) {
    .header {
        padding: 0 10px;
        top: 10px;
    }

    nav {
        padding: 10px 20px;
        gap: 1rem;
    }

    .nav-links {
        display: none;
    }

    /* Hide for now on mobile, add burger later */

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content p {
        margin: 0 auto 2rem;
    }

    .hero-visual {
        height: 300px;
    }

    .ai-sphere {
        width: 250px;
        height: 250px;
    }

    .project-card,
    .project-card:nth-child(even) {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 1.5rem;
    }

    .project-preview {
        height: 250px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

/* =========================================
   RESTORED SECTIONS STYLING
   ========================================= */

/* Experience Section (Timeline) */
.experience {
    padding: 8rem 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
}

.timeline-item {
    padding: 2rem 0;
    position: relative;
    width: 50%;
    padding-right: 3rem;
}

.timeline-item:nth-child(even) {
    margin-left: 50%;
    padding-left: 3rem;
    padding-right: 0;
}

.timeline-dot {
    position: absolute;
    right: -6px;
    top: 2.5rem;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -6px;
    right: auto;
}

.timeline-content {
    background: var(--bg-card);
    border: var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    position: relative;
}

/* Timeline with Enhanced Visibility */
.timeline-content h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
}

.timeline-content .duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Research Section */
.research {
    padding: 8rem 0;
}

.research-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--bg-glass);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    align-items: center;
}

.pdf-container {
    height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
}

/* Blogs Section */
.blogs {
    padding: 8rem 0;
}

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-10px);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-date {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.blog-content h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.blog-content .read-more {
    margin-top: auto;
    color: var(--primary);
    font-weight: 600;
}

/* Success Stories Section */
.success-stories {
    padding: 8rem 0;
}

.success-grid {
    display: flex;
    gap: 3rem;
    transition: transform 0.5s ease;
}

.success-card {
    min-width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    /* Reduced from 3rem to 2rem to give more space */
    align-items: center;
    /* Center Vertically */
    height: 500px;
    /* FIXED HEIGHT */
    overflow: hidden;
    /* Ensure content stays within bounds */
}

/* Updated Success Content Structure */
.success-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Reduced gap */
    height: 100%;
    justify-content: flex-start;
    /* Start from top */
    overflow: hidden;
    /* Hide overflow text */
    position: relative;
    /* For absolute button */
    padding-bottom: 50px;
    /* Reserve space for button */
}

.success-info-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.success-title {
    font-size: 0.9rem;
    /* Sligthly smaller title */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0;
}

.success-text {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ensure button is always visible */
.success-content .read-more-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    margin-top: 0 !important;
}

.success-visual {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    /* Fill container height */
    max-height: 400px;
    /* But limit max */
    background: #000;
}

.success-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Show full image as proof */
    background: #000;
}

/* Modal System */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    width: 900px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #0f0f13;
    /* Solid background for readability */
    border: 1px solid var(--primary);
    padding: 3rem;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 242, 234, 0.2);
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: var(--secondary);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

.success-text-full {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-line;
}

/* Responsive Success Stories */
@media screen and (max-width: 968px) {
    .success-card {
        grid-template-columns: 1fr;
        padding: 2rem;
        height: auto;
        /* Auto height on mobile */
        min-height: 500px;
    }

    .success-visual {
        height: 250px;
        order: -1;
        /* Image first on mobile */
    }

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

    .modal-content {
        padding: 2rem;
    }
}


/* Contact Specifics */
.contact {
    padding: 8rem 0;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Contact Section with 3D */
.contact {
    padding: 8rem 0;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    background: var(--bg-glass);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: var(--glass-border);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

.contact-item h4 {
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.contact-item a {
    color: var(--text-light);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-family: var(--font-main);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}

.contact-item i {
    color: var(--primary);
    font-size: 1.5rem;
}

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

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-main);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Mobile fixes for Timeline */
@media screen and (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 3rem;
        padding-right: 0;
    }

    .timeline-item:nth-child(even) {
        margin-left: 0;
    }

    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 14px;
    }

    .research-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

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

/* Carousel Styles */
.carousel-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.blogs-track-container {
    overflow: hidden;
    width: 100%;
    /* Ensure content doesn't spill */
}

.blogs-grid {
    display: flex;
    /* Changed from grid to flex for sliding */
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.blog-card {
    min-width: calc(33.333% - 1.35rem);
    /* Show 3 items minus gap */
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .blog-card {
        min-width: calc(50% - 1rem);
        /* Show 2 items on tablet */
    }
}

@media (max-width: 580px) {
    .blog-card {
        min-width: 100%;
        /* Show 1 item on mobile */
    }
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Standardized Carousel Cards */
/* Blog and Project Cards with 3D */
.blog-card {
    flex: 0 0 calc((100% - 4rem) / 3);
    min-width: calc((100% - 4rem) / 3);
    height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
}

.blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.blog-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 0;
    color: var(--text-light);
}

.blog-content .read-more {
    margin-top: auto;
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.project-desc-carousel {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-title-carousel {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 242, 234, 0.1), rgba(255, 0, 85, 0.1));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.blog-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(2deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 242, 234, 0.2);
    border-color: rgba(0, 242, 234, 0.3);
}

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

.blogs-grid {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    padding: 1rem 0;
}

.blog-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.1) rotateZ(2deg);
    filter: brightness(1.1) saturate(1.2);
}

/* Project Cards with Enhanced 3D */
.project-card-carousel {
    flex: 0 0 100%;
    min-width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(22, 22, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    transform-style: preserve-3d;
}

.project-card-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 242, 234, 0.05), rgba(112, 0, 255, 0.05));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.project-card-carousel:hover {
    transform: translateY(-10px) rotateX(3deg) rotateY(2deg);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 242, 234, 0.2);
}

.project-card-carousel:hover::before {
    opacity: 1;
}

.blog-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.blog-date {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.blog-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit title lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 0;
}

.blog-content .read-more {
    margin-top: auto;
    /* Push to bottom */
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.blog-content .read-more:hover {
    color: var(--primary);
}

@media (max-width: 968px) {
    .blog-card {
        /* 2 items with 2rem gap: (100% - 2rem) / 2 */
        flex: 0 0 calc((100% - 2rem) / 2);
        min-width: calc((100% - 2rem) / 2);
        height: 450px;
    }
}

@media (max-width: 580px) {
    .blog-card {
        flex: 0 0 100%;
        min-width: 100%;
        height: auto;
    }
}

/* Project Carousel Cards (Redesigned) */
#projects-container.blogs-grid {
    /* Reuse the same flex properties as blogs-grid */
    display: flex;
    gap: 2rem;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    padding: 1rem 0;
}

.project-card-carousel {
    /* 1 Project per view as requested */
    flex: 0 0 100%;
    min-width: 100%;
    height: 600px;
    /* Taller for single view to show more content */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(22, 22, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    position: relative;
}

.project-card-carousel:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

/* Project Metrics Styling */
.project-metrics {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.metric-value {
    color: #00f2ea;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 242, 234, 0.4);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -----------------------------------------
   TECH STACK REDESIGN
   ----------------------------------------- */
.tech-stack-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem 0;
}

/* Skills Grid with 3D Effects */
.tech-stack-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem 0;
}

.tech-category-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
}

.skill-percent {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    text-align: right;
    font-weight: 600;
}

.tech-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 242, 234, 0.1), rgba(112, 0, 255, 0.1));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.tech-category-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -10px rgba(0, 242, 255, 0.2), 0 0 30px rgba(0, 242, 234, 0.1);
}

.tech-category-card:hover::before {
    opacity: 1;
}

.category-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 700;
    /* Use Primary Cyan for titles for better visibility */
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.category-line {
    width: 60px;
    height: 3px;
    /* Gradient from Primary to Secondary */
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 0 auto;
    border-radius: 2px;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.skill-item {
    display: grid;
    grid-template-columns: 200px 1fr 45px;
    align-items: center;
    gap: 1rem;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

.skill-icon-sm {
    /* Use Secondary for icons to contrast with Primary title */
    color: var(--secondary);
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(112, 0, 255, 0.4));
}

.skill-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Progress bars with 3D glow */
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 3px;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
    0% { box-shadow: 0 0 15px rgba(0, 242, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
    100% { box-shadow: 0 0 25px rgba(0, 242, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
}

/* Glow effect for progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    background: #fff;
    opacity: 0.7;
    filter: blur(2px);
}

.skill-percent {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    text-align: right;
    font-weight: 600;
}

/* Responsive Tech Stack */
@media (max-width: 968px) {
    .tech-stack-container {
        grid-template-columns: 1fr;
    }

    .skill-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .skill-progress {
        display: none;
        /* Hide progress bars on very small screens if needed, or adjust grid */
    }

    .skill-percent {
        display: none;
    }
}

@media (min-width: 580px) and (max-width: 968px) {
    .skill-item {
        grid-template-columns: 180px 1fr 40px;
        /* Keep layout on tablets */
    }

    .skill-progress,
    .skill-percent {
        display: block;
    }
}

.project-preview-carousel {
    width: 100%;
    height: 350px;
    /* Larger preview for single view */
    overflow: hidden;
    position: relative;
}

.project-preview-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card-carousel:hover .project-preview-carousel img {
    transform: scale(1.05);
}

.project-content-carousel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.project-title-carousel {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.project-desc-carousel {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-stack-carousel {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
    /* Push to bottom */
    margin-bottom: 1rem;
}

.tech-tag-sm {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.project-links-carousel {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* Responsive adjustments reuse logic from blog-card via JS calculation */
@media (max-width: 968px) {
    .project-card-carousel {
        flex: 0 0 calc((100% - 2rem) / 2);
        min-width: calc((100% - 2rem) / 2);
    }
}

/* Professional AI Developer Animations */
@keyframes codeFloat {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg);
    }
    50% {
        transform: translateY(-8px) rotateX(2deg);
    }
}

@keyframes terminalPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
        border-color: var(--primary);
    }
    50% {
        box-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
        border-color: var(--success);
    }
}

@keyframes dataStream {
    0% {
        opacity: 0.6;
        text-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(63, 185, 80, 0.7);
    }
    100% {
        opacity: 0.6;
        text-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
    }
}

/* Apply professional animations */
.glass-panel {
    animation: codeFloat 8s ease-in-out infinite;
}

.glass-panel:nth-child(even) {
    animation: codeFloat 8s ease-in-out infinite reverse;
    animation-delay: -3s;
}

.hero-content h1 {
    animation: dataStream 3s ease-in-out infinite;
}

.profile-img {
    animation: terminalPulse 6s ease-in-out infinite;
}

.t-gradient {
    animation: dataStream 4s ease-in-out infinite;
}

/* Floating Like Button */
.floating-like-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
    transform-style: preserve-3d;
}

.floating-like-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--primary);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px rgba(88, 166, 255, 0.3);
}

.floating-like-btn i {
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.floating-like-btn:hover i {
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--primary);
}

.like-count {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
    font-weight: 600;
}

/* Lightning Drop Animation */
.lightning-drop {
    position: fixed;
    font-size: 1.5rem;
    color: var(--primary);
    pointer-events: none;
    z-index: 999;
    animation: lightningDrop 2s ease-out forwards;
}

@keyframes lightningDrop {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
        filter: drop-shadow(0 0 5px var(--primary));
    }
    50% {
        opacity: 0.8;
        transform: translateY(-100px) scale(1.2) rotate(180deg);
        filter: drop-shadow(0 0 15px var(--primary));
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.5) rotate(360deg);
        filter: drop-shadow(0 0 25px var(--primary));
    }
}

@media (max-width: 768px) {
    .floating-like-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-like-btn i {
        font-size: 1.2rem;
    }
    
    .like-count {
        font-size: 0.6rem;
    }
}