/* 
  Global Variables 
  - Switch to Dark Theme palette
*/
:root {
    --primary-color: #3b82f6;
    /* Lighter blue for better contrast on dark */
    --primary-hover: #2563eb;
    --text-dark: #f8fafc;
    /* White text */
    --text-light: #cbd5e1;
    /* Light gray for secondary text */
    --bg-body: #0f172a;
    /* Dark blue/slate background */
    --bg-card: rgba(15, 23, 42, 0.7);
    /* Dark semi-transparent card */
    --border-color: rgba(255, 255, 255, 0.1);
    /* Subtle white border */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --radius: 0.5rem;
    --transition: all 0.2s ease-in-out;
    --container-width: 1100px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Page Backgrounds - Animated */
/* We use pseudo-elements on body to separate image and overlay */

body {
    position: relative;
    /* Ensure body is a positioning context if needed */
    background-color: var(--bg-body);
    /* Fallback */
}

/* The Background Image Layer (Animated) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Increased z-index to be above body background color but below content */
    z-index: -10;

    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Stronger animation: zoom + slight shift */
    animation: background-drift 40s ease-in-out infinite alternate;
}

/* The Dark Overlay Layer (Static) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -5;
    /* Above image, below content */

    /* Slightly more transparent to see the image better */
    background: linear-gradient(rgba(10, 15, 30, 0.6), rgba(10, 15, 30, 0.7));
    pointer-events: none;
}

@keyframes background-drift {
    0% {
        transform: scale(1.0) translate3d(0, 0, 0);
    }

    50% {
        transform: scale(1.15) translate3d(-3%, -2%, 0);
    }

    100% {
        transform: scale(1.1) translate3d(2%, 1%, 0);
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* Remove old specific class rules as they are superseded by body::before */
.page-about-me,
.page-experience,
.page-education {
    background: none;
}

/* Particle System for Comet Effect - More Visible */
.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
    /* Above overlay */
    filter: blur(0.5px);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Comet tail effect - More obvious */
.particle::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 1px;
    background: linear-gradient(-90deg, rgba(255, 255, 255, 0.4), transparent);
    top: 50%;
    left: -80px;
    transform: translateY(-50%);
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0;
    }

    15% {
        opacity: 0.8;
    }

    85% {
        opacity: 0.8;
    }

    100% {
        transform: translate3d(var(--drift-x), var(--drift-y), 0);
        opacity: 0;
    }
}

/* Disable particles for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .particle {
        display: none;
    }
}

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

ul {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

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

.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 
  Navigation 
*/
.navbar {
    background-color: rgba(15, 23, 42, 0.8);
    /* Dark glass */
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

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

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-dark);
}

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

.nav-link {
    color: var(--text-light);
    font-weight: 500;
}

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

/* 
  Hero Section 
*/
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: transparent;
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    text-align: left;
}

.hero-text {
    flex: 1;
}

.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
}

.hero-greeting {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.hero-title {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #ffffff;
    /* Bright white title */
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

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

.card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    background: rgba(30, 41, 59, 0.9);
    /* Slightly lighter dark on hover */
    border-color: var(--primary-color);
}

.card-img-placeholder {
    height: 200px;
    background-color: #334155;
    /* Dark gray placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.card-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.card-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.card-link:hover {
    text-decoration: underline;
}

/* 
  Experience Section 
*/
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 3rem;
    border-left: 2px solid var(--border-color);
}

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

/* Timeline Dot - Default State */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 5px;
    /* Aligned with title roughly */
    width: 16px;
    height: 16px;
    background: var(--bg-body);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Color Classes Definitions */
.experience-blue {
    --item-color: #3b82f6;
}

.experience-gold {
    --item-color: #fbbf24;
}

.experience-red {
    --item-color: #ef4444;
}

.experience-pink {
    --item-color: #ec4899;
    /* Vibrant Pink */
}

/* Interactive Hover Logic: Link Title Hover -> Dot Change */
/* Using :has() to style the dot when the title is hovered */
@supports selector(:has(*)) {
    .timeline-item:has(.timeline-role:hover)::before {
        border-color: var(--item-color, var(--primary-color));
        background-color: var(--item-color, var(--primary-color));
        box-shadow: 0 0 10px var(--item-color, var(--primary-color));
    }
}

/* Fallback: Hovering the title itself changes its own color */
.timeline-role {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
    cursor: default;
    /* Imply interactivity */
}

/* When hovering the role, change the role color */
.timeline-item .timeline-role:hover {
    color: var(--item-color, var(--primary-color));
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.timeline-company {
    font-size: 1.1rem;
    /* Use the item color (blue/gold/red) if defined, else fallback to primary */
    color: var(--item-color, var(--primary-color));
    margin-bottom: 1rem;
    display: inline-block;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.timeline-company:hover {
    /* Make the color slightly brighter/more vivid on hover */
    filter: brightness(1.3);
    border-bottom-color: currentColor;
}

/* Education Links */
.edu-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.edu-link:hover {
    color: #a855f7;
    /* Premium Purple */
}

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

/* 
  Education & Qualifications Section 
*/
.edu-grid {
    display: grid;
    gap: 2rem;
}

.edu-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.edu-crest {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    /* Optional: if it's circular */
    background: white;
    /* Ensure transparency looks good */
    padding: 2px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-badge {
    background: rgba(59, 130, 246, 0.1);
    /* Subtle blue tint */
    color: #60a5fa;
    /* Lighter blue text */
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Refined Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem;
}

.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.lang-item:hover {
    border-bottom-color: var(--primary-color);
    transform: translateX(5px);
}

.lang-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1.1rem;
}

.lang-level {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
    .languages-grid {
        grid-template-columns: 1fr;
    }
}

/* 
  Contact Section 
*/
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
}

.contact-link {
    display: none;
    /* Hide old class if present */
}

.contact-icon {
    font-size: 2rem;
    color: #ffffff;
    /* Pure white */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Smooth Apple-like ease */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Soft, elegant glow - subtle but effective on dark bg */
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    opacity: 0.9;
}

.contact-icon:hover {
    color: #ffffff;
    transform: scale(1.15);
    /* Slight scale up without translateY */
    opacity: 1;
    /* Stronger, crisp glow on hover */
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
}

/* 
  Footer 
*/
.footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    color: var(--text-light);
}

/* 
  Responsive 
*/
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        /* Put image on top on mobile */
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .timeline {
        padding-left: 1rem;
    }

    .section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }
}

/* 
  Custom Cursor Styles 
*/

/* Default State: Hidden (for touch devices) */
.custom-cursor-dot,
.custom-cursor-ring {
    display: none;
}

/* Enable only on devices that support hover AND have a fine pointer (mouse) */
@media (hover: hover) and (pointer: fine) {

    body,
    a,
    button,
    .clickable {
        cursor: none !important;
    }

    .custom-cursor-dot,
    .custom-cursor-ring {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 9999;
        border-radius: 50%;
        transform: translate(-100px, -100px);
        /* Initial off-screen */
    }
}

/* The inner dot */
.custom-cursor-dot {
    width: 6px;
    height: 6px;
    background-color: #00f3ff;
    /* Cyan neon default */
    margin-left: -3px;
    /* Center alignment */
    margin-top: -3px;
    transition: width 0.3s, height 0.3s, background-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
    /* Cyan glow */
}

/* The trailing outer ring */
.custom-cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-left: -16px;
    /* Center alignment */
    margin-top: -16px;
    transition: width 0.3s, height 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(2px);
    /* Glass effect */
}

/* Hover State - General */
.custom-cursor-dot.hover {
    width: 4px;
    height: 4px;
    margin-left: -2px;
    margin-top: -2px;
    background-color: transparent;
    /* Dot disappears or fades */
    box-shadow: none;
}

.custom-cursor-ring.hover {
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    border-color: rgba(0, 243, 255, 0.8);
    background-color: rgba(0, 243, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

/* Active (Click) State */
.custom-cursor-ring.active {
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    border-color: #00f3ff;
    background-color: rgba(0, 243, 255, 0.1);
}

/* COLOR VARIANTS */

/* Blue */
.custom-cursor-ring.cursor-blue.hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.custom-cursor-dot.cursor-blue {
    background-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* Gold */
.custom-cursor-ring.cursor-gold.hover {
    border-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.1);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.custom-cursor-dot.cursor-gold {
    background-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

/* Pink */
.custom-cursor-ring.cursor-pink.hover {
    border-color: #ec4899;
    background-color: rgba(236, 72, 153, 0.1);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.custom-cursor-dot.cursor-pink {
    background-color: #ec4899;
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.6);
}

/* Red */
.custom-cursor-ring.cursor-red.hover {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.custom-cursor-dot.cursor-red {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {

    .custom-cursor-dot,
    .custom-cursor-ring {
        display: none !important;
    }

    body,
    a,
    button {
        cursor: auto !important;
    }
}