/* ============================================
   PROJECTS SECTION - HOMEPAGE CAROUSEL
   ============================================ */

#projects {
    padding: 40px 0;
    overflow: hidden;
}

.projects-container {
    max-width: calc(100vw - 40px);
    margin: 0 auto;
    padding: 20px 0;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0;
    overflow: visible;
}

.project-cards {
    display: flex;
    gap: 0;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 60px calc(50vw - 550px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.project-cards::-webkit-scrollbar {
    display: none;
}

.project-card {
    min-width: 1100px;
    max-width: 1100px;
    height: 500px;
    padding: 45px;
    scroll-snap-align: center;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);

    transform: scale(0.85);
    opacity: 0.5;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    margin-right: -250px;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
}

.project-card:last-child {
    margin-right: 0;
}

.project-card.active {
    transform: scale(1);
    opacity: 1;
    z-index: 10;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.project-card:not(.active):hover {
    transform: scale(0.88) translateY(-8px);
    opacity: 0.75;
    z-index: 8;
}

.project-card.active:hover {
    transform: scale(1) translateY(-8px);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.18);
}

.project-card h3 {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--text);
}

.project-status {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-1);
    color: var(--text);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.project-description {
    line-height: 1.7;
    margin-bottom: 24px;
    opacity: 0.9;
    font-size: 1.05rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.tech-badge {
    padding: 8px 16px;
    background: color-mix(in srgb, var(--accent-2), transparent 70%);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.indicator-dot {
    width: 80px;
    height: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--accent-2), transparent 80%);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.indicator-dot:hover {
    background: color-mix(in srgb, var(--accent-2), transparent 70%);
    transform: scaleY(1.3);
}

.indicator-dot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-2);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.indicator-dot.active {
    background: color-mix(in srgb, var(--accent-2), transparent 70%);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2), transparent 50%);
}

.indicator-dot.active::before {
    animation: fillProgress 5s linear forwards;
}

.indicator-dot.active.paused::before {
    animation-play-state: paused;
}

@keyframes fillProgress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.carousel-progress {
    text-align: center;
    margin-top: 15px;
    opacity: 0.7;
    font-size: 0.95rem;
}

/* ============================================
    PROJECTS LIST PAGE
   ============================================ */

.projects-page {
    min-height: 100vh;
    padding-top: 40px;
}

.projects-page-title {
    font-size: 3rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 60px;
}

.projects-scroll-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 80px;
}

.full-project-card {
    width: 1260px;
    height: 500px;
    margin: 0 auto 60px;

    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);

    transition: all 0.3s ease;
}

.full-project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.project-card-content {
    padding: 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.project-header h2 {
    font-size: 2.5rem;
    color: var(--text);
}

.project-status-badge {
    padding: 8px 20px;
    background: var(--accent-1);
    color: var(--text);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.project-full-description {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text);
    opacity: 0.9;
    flex-grow: 1;
}

.project-resume-lines {
    list-style: none;
    padding-left: 0;
}

.project-resume-lines li {
    padding-left: 25px;
    margin-bottom: 12px;
    position: relative;
    font-size: 1rem;
    line-height: 1.6;
}

.project-resume-lines li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: bold;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-tag {
    padding: 10px 18px;
    background: color-mix(in srgb, var(--accent-2), transparent 70%);
    color: var(--text);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 16px;
}

/* Side navigation indicators */
.side-indicators {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-2), transparent 70%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.side-dot:hover {
    background: var(--accent-2);
    transform: scale(1.3);
}

.side-dot.active {
    background: var(--accent-2);
    transform: scale(1.5);
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2), transparent 40%);
}

/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */

.project-detail-page {
    min-height: 100vh;
    padding: 40px 20px 80px;
}

.project-detail-card {
    max-width: 1200px;
    margin: 0 auto;

    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);

    padding: 60px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent-1), transparent 80%);
}

.detail-header h1 {
    font-size: 3rem;
    color: var(--text);
    margin-bottom: 15px;
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.detail-section {
    margin-bottom: 40px;
}

.detail-section h2 {
    font-size: 1.8rem;
    color: var(--accent-2);
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 12px;
}

.detail-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    opacity: 0.9;
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.use-case-card {
    padding: 20px;
    background: color-mix(in srgb, var(--accent-2), transparent 90%);
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent-1), transparent 70%);
}

.use-case-card h3 {
    font-size: 1.1rem;
    color: var(--accent-2);
    margin-bottom: 10px;
}

.use-case-card p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Code Samples */
.code-sample {
    margin-bottom: 25px;
}

.code-sample pre {
    background: color-mix(in srgb, var(--bg-secondary), transparent 50%);
    border: 1px solid color-mix(in srgb, var(--accent-1), transparent 70%);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.code-sample code {
    color: var(--text);
}

/* Image Samples */
.image-sample {
    margin-bottom: 25px;
}

.image-sample img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent-1), transparent 70%);
}

/* Achievements List */
.achievements-list {
    list-style: none;
    padding: 0;
}

.achievements-list li {
    padding-left: 30px;
    margin-bottom: 15px;
    position: relative;
    font-size: 1.05rem;
    line-height: 1.7;
}

.achievements-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent-2);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Technology Logos */
.tech-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.tech-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: color-mix(in srgb, var(--accent-2), transparent 90%);
    border-radius: 12px;
    min-width: 100px;
    min-height: 100px;
    justify-content: center;
}

.tech-logo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tech-logo-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;

    /* Recolor SVGs to match theme */
    filter: brightness(0) saturate(100%) invert(48%) sepia(13%) saturate(1309%) hue-rotate(54deg) brightness(91%) contrast(88%);

    transition: filter 0.3s ease;
}

/* If no image, make text bigger and centered */
.tech-logo-item:not(:has(img)) .tech-name {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Normal tech name under logo */
.tech-logo-item:has(img) .tech-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

/* Light mode logos */
body:not(.dark-mode) .tech-logo-item img {
    filter: brightness(0) saturate(100%) invert(28%) sepia(13%) saturate(1309%) hue-rotate(54deg) brightness(71%) contrast(88%);
}

.tech-logo-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

/* Language Breakdown */
.language-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.language-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.language-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.language-percent {
    font-size: 0.9rem;
    color: var(--accent-2);
    font-weight: 600;
}

.language-bar-bg {
    height: 12px;
    background: color-mix(in srgb, var(--accent-2), transparent 85%);
    border-radius: 6px;
    overflow: hidden;
}

.language-bar-fill {
    height: 100%;
    background: var(--accent-2);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* ============================================
    MOBILE RESPONSIVE - ALL PROJECTS
   ============================================ */

@media (max-width: 768px) {

    /* HOMEPAGE CAROUSEL */
    #projects {
        padding: 40px 0;
    }

    .projects-container {
        padding: 10px 0;
    }

    .carousel-wrapper {
        padding: 10px 0;
    }

    .project-cards {
        padding: 40px 20px;
        gap: 20px;
    }

    .project-card {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        height: auto;
        min-height: 500px;
        padding: 30px 25px;

        margin-right: 0;
        transform: scale(1);
        opacity: 1;
    }

    .project-card.active {
        transform: scale(1);
        opacity: 1;
    }

    .project-card:hover,
    .project-card.active:hover {
        transform: translateY(0);
    }

    .project-card h3 {
        font-size: 1.6rem;
    }

    .project-description {
        font-size: 1rem;
    }

    .project-tech {
        justify-content: center;
    }

    .tech-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .project-buttons {
        flex-direction: column;
        width: 100%;
    }

    .project-buttons .btn {
        width: 100%;
    }

    .carousel-indicators {
        gap: 8px;
        margin-top: 20px;
    }

    .indicator-dot {
        width: 60px;
        height: 5px;
    }

    .carousel-progress {
        font-size: 0.9rem;
    }

    /* PROJECTS LIST PAGE */
    .projects-page {
        padding-top: 20px;
    }

    .projects-page-title {
        font-size: 2rem;
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .projects-scroll-container {
        padding: 0 20px 40px;
    }

    .full-project-card {
        width: 100%;
        height: auto;
        min-height: 350px;
        margin: 0 auto 30px;
    }

    .project-card-content {
        padding: 25px 20px;
        gap: 12px;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .project-header h2 {
        font-size: 1.5rem;
    }

    .project-status-badge {
        padding: 6px 14px;
        font-size: 0.8rem;
    }

    .project-full-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .project-resume-lines li {
        font-size: 0.85rem;
        padding-left: 20px;
        margin-bottom: 8px;
        line-height: 1.5;
    }

    .project-resume-lines li::before {
        font-size: 1rem;
    }

    .project-tech-stack {
        gap: 8px;
    }

    .tech-tag {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .project-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .project-actions .btn {
        width: 100%;
    }

    .side-indicators {
        right: 15px;
        gap: 12px;
    }

    .side-dot {
        width: 10px;
        height: 10px;
    }

    /* PROJECT DETAIL PAGE */
    .project-detail-page {
        padding: 20px 15px 60px;
    }

    .project-detail-card {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    .detail-header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .detail-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .detail-actions .btn {
        width: 100%;
    }

    .detail-section {
        margin-bottom: 25px;
    }

    .detail-section h2 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .detail-section h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .detail-section p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .use-cases-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .use-case-card {
        padding: 15px;
    }

    .use-case-card h3 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .use-case-card p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .code-sample {
        margin-bottom: 20px;
    }

    .code-sample h3 {
        font-size: 0.95rem;
    }

    .code-sample pre {
        padding: 12px;
        font-size: 0.75rem;
        line-height: 1.4;
        overflow-x: auto;
    }

    .image-sample img {
        border-radius: 8px;
    }

    .achievements-list li {
        font-size: 0.85rem;
        padding-left: 25px;
        margin-bottom: 10px;
        line-height: 1.5;
    }

    .achievements-list li::before {
        font-size: 1rem;
    }

    .tech-logos {
        gap: 12px;
        justify-content: center;
    }

    .tech-logo-item {
        padding: 12px;
        min-width: 80px;
    }

    .tech-logo-item img {
        width: 36px;
        height: 36px;
    }

    .tech-logo-item span {
        font-size: 0.8rem;
    }

    .language-bars {
        gap: 12px;
    }

    .language-name {
        font-size: 0.9rem;
    }

    .language-percent {
        font-size: 0.8rem;
    }

    .language-bar-bg {
        height: 10px;
    }

    .tech-logo-item {
        padding: 12px;
        min-width: 80px;
        min-height: 80px;
    }

    .tech-logo-item img {
        width: 36px;
        height: 36px;
    }

    .tech-logo-item:not(:has(img)) .tech-name {
        font-size: 0.85rem;
    }

    .tech-logo-item:has(img) .tech-name {
        font-size: 0.8rem;
    }
}