/* 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', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header and Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav__brand {
    flex-shrink: 0;
}

.nav__name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.nav__menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav__link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav__link:hover,
.nav__link--active {
    color: #2563eb;
}

.nav__link--active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #2563eb;
    border-radius: 1px;
}

.nav__toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.25rem;
}

.nav__toggle-line {
    width: 1.5rem;
    height: 2px;
    background-color: #64748b;
    transition: all 0.3s ease;
}

/* Main content */
.main {
    margin-top: 80px;
}

/* Hero section */
.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.hero__content {
    max-width: 800px;
}

.hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    line-height: 1.2;
}

.hero__name {
    color: #2563eb;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.hero__tagline {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn--primary {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

.btn--primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn--secondary {
    background-color: transparent;
    color: #2563eb;
    border-color: #2563eb;
}

.btn--secondary:hover {
    background-color: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}

/* Sections */
.section {
    padding: 6rem 0;
}

.section:nth-child(even) {
    background-color: #f8fafc;
}

.section__title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: #1e293b;
}

.section__content {
    font-size: 1.125rem;
    color: #64748b;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    text-align: center;
}

.footer__text {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav__menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

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

    .nav__toggle {
        display: flex;
    }

    .nav__toggle.active .nav__toggle-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav__toggle.active .nav__toggle-line:nth-child(2) {
        opacity: 0;
    }

    .nav__toggle.active .nav__toggle-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

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

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

    .section {
        padding: 4rem 0;
    }

    .section__title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 1rem;
    }

    .hero__title {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1.25rem;
    }

    .hero__tagline {
        font-size: 1rem;
    }
}

/* Smooth animations */
@media (prefers-reduced-motion: no-preference) {
    .hero__content {
        animation: fadeInUp 0.8s ease-out;
    }

    .nav__link {
        transition: all 0.3s ease;
    }
}

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

/* Focus styles for accessibility */
.nav__link:focus,
.btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Terminal Effect Styling */
.terminal-container {
    background: transparent;
    margin: 2rem 0;
    font-family: 'Courier New', 'Monaco', monospace;
}

.terminal-header {
    display: none; /* Hide the terminal header */
}

.terminal-body {
    padding: 0;
    background: transparent;
    min-height: auto;
    display: flex;
    align-items: center;
}

.terminal-text {
    color: #ffffff;
    font-size: 1.6rem;
    line-height: 1.6;
    font-family: 'Courier New', 'Monaco', monospace;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
}

.command {
    color: #ffffff;
}

.cursor {
    color: #ffffff;
    animation: blink 1s infinite;
    font-weight: bold;
}

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

/* Responsive terminal */
@media (max-width: 768px) {
    .terminal-text {
        font-size: 0.9rem;
    }
    
    .terminal-body {
        padding: 1rem;
        min-height: 60px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero__name {
        -webkit-text-fill-color: initial;
        color: #1d4ed8;
    }
}

/* Custom styles for About Me section image */
#about .image.featured {
    max-width: 400px; /* Reduce from 100% to 400px */
    margin: 0 auto 2em auto; /* Center the image */
}

#about .image.featured img {
    width: 100%;
    height: auto;
    border-radius: 8px; /* Add some rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Add subtle shadow */
}

/* Justify text in About Me section */
#about p {
    text-align: justify;
    text-justify: inter-word; /* Better word spacing for justified text */
}

/* Justify text in Projects section */
#portfolio p {
    text-align: justify;
    text-justify: inter-word; /* Better word spacing for justified text */
}

/* Projects Grid Layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

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

.project-item .item {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item .item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-item .image {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.project-item .image img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.project-item .item:hover .image img {
    transform: scale(1.05);
}

.project-item header {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.project-item h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
}

/* Responsive design for projects grid */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
        gap: 1rem;
    }
}

/* Resume Section Styling */
.resume-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.resume-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #d1d5db;
}

.resume-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.resume-section h3 {
    color: #000000;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid #d1d5db;
    padding-bottom: 0.5rem;
}

.resume-section h4 {
    color: #000000;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    justify-content: center;
    text-align: center;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.95rem;
    color: #64748b;
}

.contact-info i {
    color: #000000;
    width: 16px;
}

.education-item, .experience-item, .teaching-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #000000;
}

.education-item p, .experience-item p, .teaching-item p {
    margin: 0.5rem 0;
    line-height: 1.6;
    text-align: left;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill-category {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.skill-category h4 {
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-category ul {
    margin: 0;
    padding-left: 1.2rem;
}

.skill-category li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #475569;
    font-size: 0.9rem;
    text-align: left;
}

.publication-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #000000;
    margin-bottom: 1rem;
}

.publication-item p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.publication-item a {
    color: #2563eb;
    text-decoration: none;
}

.publication-item a:hover {
    text-decoration: underline;
}

.resume-section ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.resume-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #475569;
    font-size: 0.9rem;
    text-align: left;
}

.resume-section p {
    line-height: 1.6;
    color: #475569;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    text-align: left;
}

/* Responsive design for resume */
@media (max-width: 768px) {
    .resume-content {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .education-item, .experience-item, .teaching-item {
        padding: 0.8rem;
    }
}