/* Projects Section */
.projects {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
    position: relative;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 80px;
    z-index: 1;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 16px;
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    will-change: transform;
}

.carousel-item {
    min-width: 100%;
    flex: 0 0 100%;
    display: flex;
    align-items: stretch;
}

.project-impact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.08));
    color: var(--accent);
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    line-height: 1.4;
    max-width: 100%;
}

.project-impact i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    z-index: 999999 !important;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
}

.carousel-btn:not(:disabled):hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.carousel-btn:not(:disabled):active {
    transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    min-height: 32px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: var(--accent);
    transform: scale(1.2);
}

.carousel-dot.active {
    width: 32px;
    border-radius: 6px;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}


/* Experience Section */
.experience {
    padding: 6rem 0;
    background-color: var(--bg-primary);
}

.experience-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
}

.experience-subtitle i {
    font-size: 1.8rem;
    color: var(--accent);
}

.experience-subtitle h3 {
    font-size: 1.6rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
}

.academic-subtitle {
    margin-top: 2rem;
}

.experience-list {
    /* flexible width for different screen sizes */
    width: min(95%, 900px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.experience-item {
    background-color: var(--bg-card);
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    display: flex;
    overflow: hidden;
}

.experience-item:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-5px);
}

.exp-image {
    width: 30%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    overflow: hidden;
}

.exp-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.experience-item:hover .exp-image img {
    transform: scale(1.05);
}

.exp-content {
    width: 70%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.exp-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.exp-company {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exp-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.exp-location {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.exp-description {
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

/* Academic Experience - Within Experience Section */
.academic-list {
    /* flexible width for different screen sizes */
    width: min(95%, 900px);
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: -2rem;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.academic-item {
    background-color: var(--bg-card);
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    display: flex;
    overflow: hidden;
}

.academic-item:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-5px);
}

.academic-image {
    width: 30%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    overflow: hidden;
}

.academic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.academic-item:hover .academic-image img {
    transform: scale(1.05);
}

.academic-content {
    width: 70%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.academic-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.academic-institution {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.academic-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.academic-description {
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

/* Education Section */
.education {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
}

.education-list {
    /* education already 900px, make it flexible too */
    width: min(95%, 900px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.education-item {
    background-color: var(--bg-card);
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    display: flex;
    overflow: hidden;
}

.education-item:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    transform: translateY(-5px);
}

/* Ensure experience / academic / education cards share the same minimum height
   so they appear consistent across sections */
.experience-item,
.academic-item,
.education-item {
    min-height: 260px;
}

.edu-image {
    width: 30%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    overflow: hidden;
}

.edu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.education-item:hover .edu-image img {
    transform: scale(1.05);
}

.edu-content {
    width: 70%;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.edu-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.edu-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}

.edu-info {
    flex: 1;
}

.edu-degree {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.edu-institution {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.edu-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-period::before {
    content: '📅';
    font-size: 1rem;
}

.edu-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.edu-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.8rem;
}

.edu-highlights li {
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.edu-highlights li i {
    color: var(--accent);
    margin-top: 0.2rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Projects Section */
.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 580px;
}

.project-card:hover {
    transform: translateY(-12px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

.project-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-image::before {
    opacity: 1;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.08);
}

.project-content {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tech-badge:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    color: white;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    background-color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--accent);
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-top: 0.25rem;
    width: 100%;
    text-align: center;
}

.project-link:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    gap: 0.75rem;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
