/* Scoped styles for the Project Scanner Section */
#project-scanner-section {
    position: relative;
    width: 100%;
    /* Limit height so it doesn't take over the whole page unnecessarily, 
       but enough for the 300px scanner + padding */
    height: auto;
    min-height: 500px;
    background: #000000;
    overflow: hidden;
    font-family: inherit;
    /* Inherit global font, override where needed */
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* changed from center to allow header at top */
    padding-bottom: 2rem;
}

#project-scanner-section .section-header {
    position: relative;
    /* Changed from absolute to relative flow */
    top: auto;
    z-index: 20;
    width: 100%;
    text-align: center;
    pointer-events: none;
    /* Let clicks pass through if needed */
    margin-top: 3rem;
    margin-bottom: 2rem;
}

#project-scanner-section .controls,
#project-scanner-section .speed-indicator,
#project-scanner-section .inspiration-credit {
    display: none !important;
    /* Hiding debug controls for production */
}

/* Container for the scanner effect */
#project-scanner-section .scanner-container {
    position: relative;
    width: 100%;
    height: 300px;
    /* Specific height for the stream area */
    display: flex;
    align-items: center;
    justify-content: center;
}

#project-scanner-section .card-stream {
    position: absolute;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    overflow: visible;
    /* Center vertical */
    top: 50%;
    transform: translateY(-50%);
}

#project-scanner-section .card-line {
    display: flex;
    align-items: center;
    gap: 60px;
    white-space: nowrap;
    cursor: grab;
    user-select: none;
    will-change: transform;
}

#project-scanner-section .card-line:active {
    cursor: grabbing;
}

#project-scanner-section .card-line.dragging {
    cursor: grabbing;
}

#project-scanner-section .card-wrapper {
    position: relative;
    width: 400px;
    height: 250px;
    flex-shrink: 0;
}

#project-scanner-section .card {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 250px;
    border-radius: 15px;
    overflow: hidden;
}

#project-scanner-section .card-normal {
    background: #0f172a;
    /* Fallback */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    color: white;
    z-index: 2;
    position: relative;
    overflow: hidden;
    clip-path: inset(0 0 0 var(--clip-right, 0%));
    /* Variable controls LEFT clip amount */
}

#project-scanner-section .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

#project-scanner-section .card-image:hover {
    filter: brightness(1.2) contrast(1.2);
}

#project-scanner-section .card-ascii {
    background: transparent;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 250px;
    border-radius: 15px;
    overflow: hidden;
    clip-path: inset(0 calc(100% - var(--clip-left, 0%)) 0 0);
    /* Variable controls visible width from left */
}

#project-scanner-section .ascii-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: rgba(220, 210, 255, 0.6);
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 13px;
    overflow: hidden;
    white-space: pre;
    clip-path: inset(0 calc(100% - var(--clip-left, 0%)) 0 0);
    animation: glitch 0.1s infinite linear alternate-reverse;
    margin: 0;
    padding: 0;
    text-align: left;
    vertical-align: top;
    box-sizing: border-box;
    pointer-events: none;
    background: #000;
    /* Ensure ascii has dark contrast background */
}

@keyframes glitch {
    0% {
        opacity: 1;
    }

    15% {
        opacity: 0.9;
    }

    16% {
        opacity: 1;
    }

    49% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    99% {
        opacity: 0.9;
    }

    100% {
        opacity: 1;
    }
}

#project-scanner-section .scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.4), transparent);
    animation: scanEffect 0.6s ease-out;
    pointer-events: none;
    z-index: 5;
}

@keyframes scanEffect {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

#project-scanner-section #particleCanvas {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 250px;
    z-index: 0;
    pointer-events: none;
}

#project-scanner-section #scannerCanvas {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 300px;
    z-index: 15;
    pointer-events: none;
}

/* Portfolio Section Dark Theme Continuity */
#portfolio {
    background-color: #0f172a;
    /* Matches the end of the process gradient */
    color: #ffffff;
    padding-top: 4rem;
    padding-bottom: 4rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 20px;
    margin-top: 0 !important;
    /* Merge with previous section */
}

#portfolio .section-header h2 {
    color: #ffffff !important;
}

#portfolio .section-header .category {
    color: rgba(255, 255, 255, 0.7) !important;
}