/* ============================================
   KRISHNA NAICKER - PORTFOLIO STYLES
   ============================================ */

:root {
    --color-bg-primary: #0a0e27;
    --color-bg-secondary: #101428;
    --color-bg-tertiary: #1a1f3a;
    --color-accent: #00d9ff;
    --color-accent-glow: rgba(0, 217, 255, 0.5);
    --color-text-primary: #e4e4e7;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    --font-primary: 'Inter', -apple-system, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   VANTA BACKGROUND
   ============================================ */
#vanta-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 217, 255, 0.4);
    border-radius: 50px;
    transition: var(--transition);
    max-width: 1100px;
    width: auto;
}

.navbar:hover {
    background: rgba(26, 31, 58, 0.85);
    border-color: rgba(0, 217, 255, 0.6);
}

.nav-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    animation: blink-line 0.8s ease-in-out infinite;
}

@keyframes blink-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

/* ============================================
   SOCIAL ICONS
   ============================================ */
.social-icons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.social-icon:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
    box-shadow: 0 0 20px var(--color-accent-glow);
    transform: translateY(-5px);
}

.social-icon svg {
    transition: var(--transition);
}

/* ============================================
   SECTIONS
   ============================================ */
section {
    padding: 6rem 2rem;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

/* ============================================
   TERMINAL CARD - ABOUT SECTION
   ============================================ */
.terminal-card {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(16, 20, 40, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(26, 31, 58, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.8;
}

.terminal-line {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.prompt {
    color: var(--color-accent);
    margin-right: 0.5rem;
}

.terminal-output {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: var(--color-accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ============================================
   SKILLS SECTION - BUBBLE LAYOUT
   ============================================ */
.skills-bubble-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 10;
}

.skill-bubble {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 31, 58, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    margin-bottom: 20px;
}

.skill-bubble img {
    width: 45px;
    height: 45px;
    transition: all 0.3s ease;
}

.skill-bubble:hover {
    transform: scale(1.3);
    background: rgba(0, 217, 255, 0.2);
    border-color: var(--color-accent);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.4);
    z-index: 100;
}

.skill-bubble:hover img {
    filter: brightness(1.3) drop-shadow(0 0 10px var(--color-accent));
}

/* Tooltip ABOVE the bubble */
.skill-bubble::after {
    content: attr(data-skill);
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 217, 255, 0.95);
    color: #0a0e27;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
    z-index: 101;
}

/* Arrow pointing down from tooltip */
.skill-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 217, 255, 0.95);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 101;
}

.skill-bubble:hover::after,
.skill-bubble:hover::before {
    opacity: 1;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 10;
}

.project-card {
    background: rgba(26, 31, 58, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
}

.project-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.15);
}

.project-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--color-text-primary);
}

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

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

.tag {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 217, 255, 0.1);
    color: var(--color-accent);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

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

.project-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    text-align: center;
}

.contact-email {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact-email a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.contact-email a:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.contact-text {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

.contact-btn {
    display: block;
    margin: 0 auto;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.contact-btn:hover {
    background: var(--color-accent);
    color: #0a0e27;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
}

/* ============================================
   SUCCESS MESSAGE - OPTIMIZED FOR MOBILE
   ============================================ */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 217, 255, 0.95);
    color: #0a0e27;
    padding: 1.2rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0, 217, 255, 0.5);
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    text-align: center;
    max-width: 90%;
}

.success-message.show {
    opacity: 1;
}

/* ============================================
   CONTACT MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-bg-secondary);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 217, 255, 0.2);
}

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

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

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.modal-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--color-accent);
    border: none;
    border-radius: 8px;
    color: var(--color-bg-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background: #00b8d4;
    box-shadow: 0 0 30px var(--color-accent-glow);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-note {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.modal-note a {
    color: var(--color-accent);
    text-decoration: none;
}

.modal-note a:hover {
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

/* Initial state - hidden and positioned */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated state - visible */
.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* About section fade in */
.about-section.animate-on-scroll {
    transform: translateY(60px);
}

.about-section.animate-in {
    transform: translateY(0);
}

/* Terminal card with scale effect */
.terminal-card.animate-on-scroll {
    opacity: 0;
    transform: scale(0.9) translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.terminal-card.animate-in {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Section titles */
.section-title.animate-on-scroll {
    opacity: 0;
    transform: translateY(-30px);
}

.section-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Skill bubbles pop in */
.skill-bubble.animate-on-scroll {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-bubble.animate-in {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Project cards slide up */
.project-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Contact section */
.contact-section.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
}

.contact-section.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet and small laptop */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.9rem 1.5rem;
    }

    .nav-container {
        gap: 1.2rem;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Remove body padding-top as navbar is now compact */
    body {
        padding-top: 0;
    }

    /* Compact navbar for mobile */
    .navbar {
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100% - 2rem);
        padding: 0.7rem 1.2rem;
        border-radius: 25px;
    }
    
    .nav-container {
        gap: 0.9rem;
        justify-content: center;
        flex-wrap: nowrap;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0;
    }

    /* Hero spacing adjustments */
    .hero-section {
        padding-top: 5rem;
        min-height: 100vh;
    }

    /* Terminal card */
    .terminal-card {
        max-width: 95%;
        margin: 1rem auto;
    }

    .terminal-body {
        padding: 1rem;
        font-size: 0.9rem;
    }

    /* Skills */
    .skills-bubble-container {
        gap: 1.2rem;
        padding: 2rem 1rem;
    }

    .skill-bubble {
        width: 70px;
        height: 70px;
    }

    .skill-bubble img {
        width: 38px;
        height: 38px;
    }

    /* Projects */
    .projects-grid {
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    /* Success message - one line on mobile */
    .success-message {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 10px;
        max-width: 85%;
        white-space: nowrap;
    }

    /* Modal adjustments */
    .modal-content {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    /* Ultra-compact navbar */
    .navbar {
        top: 0.8rem;
        width: auto;
        max-width: calc(100% - 1.5rem);
        padding: 0.6rem 1rem;
        border-radius: 20px;
    }

    .nav-container {
        gap: 0.7rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.25rem 0;
    }

    /* Hero adjustments */
    .hero-section {
        padding-top: 4.5rem;
    }

    .hero-name {
        font-size: clamp(2rem, 9vw, 3.5rem);
    }

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

    .social-icon {
        width: 44px;
        height: 44px;
    }

    /* Sections */
    section {
        padding: 3.5rem 1rem;
    }

    /* Terminal */
    .terminal-card {
        margin: 0.8rem auto;
        border-radius: 10px;
    }

    .terminal-body {
        font-size: 0.85rem;
        padding: 0.9rem;
    }

    /* Skills */
    .skills-bubble-container {
        gap: 1rem;
        padding: 1.5rem 0.8rem;
    }

    .skill-bubble {
        width: 60px;
        height: 60px;
    }

    .skill-bubble img {
        width: 32px;
        height: 32px;
    }

    /* Projects */
    .project-card {
        padding: 1.2rem;
    }

    /* Success message - compact one-liner */
    .success-message {
        padding: 0.9rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 8px;
        max-width: 90%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Submit button */
    .submit-btn {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .navbar {
        padding: 0.5rem 0.8rem;
    }

    .nav-container {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.7rem;
    }

    .success-message {
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
    }
}

/* Accessibility - Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .animate-on-scroll.animate-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}