/* 
 * Modern ML Portfolio Theme
 * Focus: Clean, Technical, Professional
 */

:root {
    /* Color Palette - Dark Professional Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #3b82f6;
    /* Technical Blue */
    --accent-hover: #2563eb;
    --border-color: #333333;

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* Scroll Animation Classes */
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grids if needed, enables simplified JS */
.skill-card:nth-child(2) {
    transition-delay: 0.1s;
}

.skill-card:nth-child(3) {
    transition-delay: 0.2s;
}

.skill-card:nth-child(4) {
    transition-delay: 0.3s;
}

.skill-card:nth-child(5) {
    transition-delay: 0.4s;
}

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

html {
    scroll-behavior: smooth;
}

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

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

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.accent {
    color: var(--accent);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

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

.nav-links a:hover {
    color: var(--text-primary);
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-medium);
    font-size: 0.95rem;
}

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

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

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: var(--header-height);
    position: relative;
    background: radial-gradient(circle at 50% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-subtitle {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, #a5a5a5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-role {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
    animation: fadeBounce 2s infinite;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 2px;
    height: 6px;
    background-color: var(--text-secondary);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}

/* Keyframes */
@keyframes scrollWheel {
    0% {
        top: 6px;
        opacity: 1;
    }

    100% {
        top: 18px;
        opacity: 0;
    }
}

@keyframes fadeBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Section Common Styles */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
    max-width: 300px;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-role {
        font-size: 1.5rem;
    }

    /* ... Mobile Responsive ... */
    .nav-links {
        display: none;
    }
}

/* 
 * Section Specific Styles 
 */

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-text .highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.profile-stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.about-details-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.about-details-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.details-list li {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.details-list strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

/* Skills Section */
.bg-secondary {
    background-color: var(--bg-secondary);
}

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

.skill-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: var(--transition-medium);
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.skill-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--accent);
}

.skill-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.skill-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Experience Section */
.timeline {
    position: relative;
    border-left: 2px solid var(--border-color);
    margin-left: 1rem;
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    /* Adjust based on padding/border */
    top: 5px;
    width: 1rem;
    height: 1rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.job-description li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    list-style-type: disc;
    margin-left: 1.5rem;
}

/* Responsive updates for grid */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        flex-direction: row;
        justify-content: space-between;
    }
}

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

.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all var(--transition-medium);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 380px;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.project-gif {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: transform var(--transition-medium);
}

.project-card:hover .project-gif {
    transform: scale(1.05);
}

.project-card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-timeline {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

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

.achievement-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
    background-color: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.achievement-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.edu-card,
.cert-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.edu-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.edu-card h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.cgpa {
    font-size: 1.1rem;
    font-weight: 600;
}

.cert-list li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.25rem;
}

.cert-list li::before {
    content: '•';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

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

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

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Responsive updates */
@media (max-width: 768px) {

    .education-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* --- Canvas Backgrounds --- */
.section-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#hero,
#about,
#skills,
#projects,
#experience,
#achievements,
#education,
#contact {
    position: relative;
}

/* Contact Section - Starry Night Background */
#contact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/starynight.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
}

#contact::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
    pointer-events: none;
}

#contact .container {
    position: relative;
}

/* Contact Form Messages */
#form-message {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    display: none;
    /* Hidden by default */
    text-align: center;
}

#form-message.success {
    display: block;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid #10b981;
}

#form-message.error {
    display: block;
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

#form-message.loading {
    display: block;
    color: var(--text-secondary);
    font-style: italic;
}

z-index: 1;
}

/* Adjustments for Centralized Text */
.text-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.center-buttons {
    justify-content: center;
}

/* Skill Card Hover Effect (Retained) */
.skill-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-card:hover {
    transform: scale(1.05) translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    z-index: 10;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-icon {
    font-size: 1.5rem;
}

.hover-reveal-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 22, 22, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem;
    pointer-events: none;
}

.skill-card:hover .hover-reveal-card {
    opacity: 1;
    pointer-events: auto;
}

.reveal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.reveal-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.reveal-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.reveal-bar {
    height: 100%;
    background-color: var(--accent);
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-out;
}

.reveal-percent {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.modal-content {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 3rem;
    z-index: 2;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

#modal-body img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 2rem;
}

#modal-body h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#modal-body .modal-timeline {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: block;
}

#modal-body h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#modal-body ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

#modal-body li {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

#modal-body .modal-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    list-style: none;
    margin-left: 0;
}

#modal-body .modal-stats li {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        max-height: 90vh;
    }

    #modal-body h2 {
        font-size: 1.5rem;
    }
}