/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* CSS Variables for theming - Aurora Glow Palette */
:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --accent-1: #8affc1; /* Minty teal - buttons, links, highlights */
    --accent-2: #7dd3fc; /* Light sky blue - secondary accents */
    --hover-gold: #ffd97a; /* Golden yellow - hover/interactive states */
    --text-primary: #ffffff;
    --text-secondary: #b8b8c8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-glow: rgba(138, 255, 193, 0.3);
    --shadow-purple: rgba(125, 211, 252, 0.3);
    --shadow-gold: rgba(255, 217, 122, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(to bottom, #0a0a0f 0%, #000000 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    isolation: isolate;
}

/* Starry night sky container */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: contents;
    isolation: isolate;
}

/* Star styling */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star.small {
    width: 1px;
    height: 1px;
    opacity: 0.6;
}

.star.medium {
    width: 2px;
    height: 2px;
    opacity: 0.8;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

.star.large {
    width: 3px;
    height: 3px;
    opacity: 1;
    box-shadow: 0 0 4px rgba(255, 255, 255, 1);
}

/* Twinkling animation */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        opacity: 1;
        -webkit-transform: scale(1.2);
        transform: scale(1.2);
    }
}

/* Staggered twinkling for different star sizes */
.star.small {
    animation-duration: 2s;
    animation-delay: 0s;
}

.star.medium {
    animation-duration: 3s;
    animation-delay: 0.5s;
}

.star.large {
    animation-duration: 4s;
    animation-delay: 1s;
}

/* Ensure content appears above stars */
.section,
.hero,
.footer {
    position: relative;
    z-index: 1;
    isolation: isolate;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: filter 0.3s ease;
}

.nav-logo:hover {
    filter: drop-shadow(0 0 8px var(--hover-gold));
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--hover-gold);
}

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

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

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(138, 255, 193, 0.15), transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(30px, -30px) rotate(5deg);
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

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

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(10deg);
    }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: var(--bg-dark);
    box-shadow: 0 8px 30px var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--hover-gold), var(--accent-1));
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-gold);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--hover-gold);
    color: var(--hover-gold);
    box-shadow: 0 0 20px var(--shadow-gold);
    transform: translateY(-2px);
}

/* Common Section Styles */
.section {
    padding: 6rem 2rem;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-glow);
    border-color: rgba(138, 255, 193, 0.3);
}

/* About Section */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-card {
    animation: fadeInUp 0.8s ease-out;
}

.about-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.skill-card:nth-child(1) {
    animation-delay: 0.1s;
}

.skill-card:nth-child(2) {
    animation-delay: 0.2s;
}

.skill-card:nth-child(3) {
    animation-delay: 0.3s;
}

.skill-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--accent-1);
    transition: color 0.3s ease, filter 0.3s ease;
}

.skill-card:hover .skill-icon {
    color: var(--hover-gold);
    filter: drop-shadow(0 0 8px var(--shadow-gold));
}

.skill-icon svg {
    width: 100%;
    height: 100%;
}

.skill-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    font-size: 1rem;
}

.skill-list li::before {
    content: '▹';
    color: var(--accent-2);
    margin-right: 0.5rem;
}

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

.project-card {
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.8s ease-out;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }

.project-card:hover {
    transform: translateY(-8px);
}

.project-card:hover .glass-card {
    box-shadow: 0 20px 60px rgba(138, 255, 193, 0.25), 0 0 40px rgba(125, 211, 252, 0.15);
    border-color: rgba(138, 255, 193, 0.4);
}

.project-header {
    margin-bottom: 1rem;
}

.project-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(138, 255, 193, 0.1);
    border: 1px solid rgba(138, 255, 193, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--accent-1);
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.project-card:hover .project-link {
    color: var(--hover-gold);
    transform: translateX(5px);
}

.project-card:hover .project-link svg {
    filter: drop-shadow(0 0 6px var(--shadow-gold));
}

/* Experience / Timeline Section */
.timeline {
    max-width: 800px;
    margin: 3rem auto 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 8px;
    width: 20px;
    height: 20px;
    background: var(--accent-1);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--shadow-glow);
    z-index: 1;
}

.timeline-content {
    animation: none;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease, filter 0.3s ease;
}

.timeline-content:hover .timeline-title {
    color: var(--hover-gold);
    filter: drop-shadow(0 0 8px var(--shadow-gold));
}

.timeline-date {
    color: var(--accent-2);
    font-weight: 500;
    font-size: 0.95rem;
}

.timeline-company {
    color: var(--accent-1);
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.education-card {
    position: relative;
    padding: 2.5rem;
    animation: fadeInUp 0.8s ease-out;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(138, 255, 193, 0.05), rgba(125, 211, 252, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

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

.education-card:nth-child(1) {
    animation-delay: 0.1s;
}

.education-card:nth-child(2) {
    animation-delay: 0.2s;
}

.education-card:nth-child(3) {
    animation-delay: 0.3s;
}

.education-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(138, 255, 193, 0.25), 0 0 40px rgba(125, 211, 252, 0.15);
    border-color: rgba(138, 255, 193, 0.4);
}

.education-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 255, 193, 0.1);
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.education-card:hover .education-icon {
    transform: scale(1.1);
    background: rgba(255, 217, 122, 0.15);
    box-shadow: 0 0 20px var(--shadow-gold);
}

.education-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: brightness(0.9);
}

.education-card:hover .education-logo {
    filter: brightness(1.1) drop-shadow(0 0 8px var(--shadow-gold));
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.education-degree {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 200px;
}

.education-date {
    color: var(--accent-2);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: rgba(125, 211, 252, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.education-card:hover .education-date {
    background: rgba(125, 211, 252, 0.15);
    border-color: rgba(125, 211, 252, 0.3);
    color: var(--accent-2);
}

.education-institution {
    color: var(--accent-1);
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.education-card:hover .education-institution {
    color: var(--hover-gold);
}

.education-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.education-highlights li {
    color: var(--text-secondary);
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.education-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: bold;
    transition: all 0.3s ease;
}

.education-card:hover .education-highlights li {
    color: var(--text-primary);
    border-left-color: rgba(138, 255, 193, 0.3);
    padding-left: 1.75rem;
}

.education-card:hover .education-highlights li::before {
    color: var(--accent-2);
    transform: translateX(5px);
}

/* Responsive adjustments for Education */
@media (max-width: 768px) {
    .education-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .education-card {
        padding: 2rem;
    }

    .education-degree {
        font-size: 1.25rem;
    }

    .education-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .education-card {
        padding: 1.5rem;
    }

    .education-icon {
        width: 70px;
        height: 70px;
        padding: 10px;
    }

    .education-degree {
        font-size: 1.1rem;
    }
}

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

.contact-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 1rem;
}

.social-link svg {
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--hover-gold);
    transform: translateY(-5px);
}

.social-link:hover svg {
    filter: drop-shadow(0 0 10px var(--shadow-gold));
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .section {
        padding: 4rem 1rem;
    }

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

    .btn {
        width: 100%;
        max-width: 250px;
    }

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

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline-dot {
        left: 6px;
        width: 10px;
        height: 10px;
    }

    .timeline-header {
        flex-direction: column;
    }

    .social-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .nav-logo {
        font-size: 1.25rem;
    }

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

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

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

    .glass-card {
        padding: 1.5rem;
    }
}

/* Scroll Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari only */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .section {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        position: relative;
        z-index: 1;
    }
    
    .hero {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        position: relative;
        z-index: 1;
    }
    
    /* Fix for content disappearing on scroll */
    #stars-container {
        z-index: -1 !important;
        position: fixed !important;
    }
    
    .container {
        position: relative;
        z-index: 2;
    }
}

/* Fix for iOS viewport height issues */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
}

/* Improve scrolling on iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

a, button {
    -webkit-tap-highlight-color: rgba(255, 217, 122, 0.3);
    cursor: pointer;
}

/* Fix for iOS text rendering */
h1, h2, h3, h4, h5, h6 {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
