/* CSS for Artifacts Page - Master-Detail Layout */

.artifacts-container {
    display: flex;
    gap: 2rem;
    min-height: 60vh;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.artifacts-sidebar {
    flex: 0 0 250px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 1rem;
}

.artifact-nav-item {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.artifact-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

.artifact-nav-item.active {
    background: rgba(51, 102, 255, 0.1);
    /* var(--glow) approx */
    border-color: var(--main-color);
    color: var(--heading-color);
    box-shadow: 0 0 15px rgba(51, 102, 255, 0.2);
}

.artifacts-viewer {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.artifact-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.artifact-content.active {
    display: block;
}

.artifact-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.artifact-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--main-color);
    text-shadow: 0 0 10px rgba(51, 102, 255, 0.4);
}

.artifact-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 800px;
}

.artifact-demo-area {
    margin-top: 2rem;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Dojo Commit Mock */
.dojo-commit-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    width: 100%;
    max-width: 700px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: #c9d1d9;
    padding: 0;
    overflow: hidden;
}

.commit-header {
    background: #161b22;
    padding: 10px 15px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.commit-meta {
    font-size: 0.85rem;
    color: #8b949e;
}

.commit-sha {
    font-family: monospace;
    color: #58a6ff;
    padding: 2px 5px;
    background: rgba(56, 139, 253, 0.1);
    border-radius: 4px;
}

.commit-body {
    padding: 15px;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.diff-add {
    background: rgba(46, 160, 67, 0.15);
    display: block;
    width: 100%;
}

.diff-del {
    background: rgba(218, 54, 51, 0.15);
    display: block;
    width: 100%;
}

/* Dojo Document Mock */
.dojo-document-mock {
    width: 210px;
    /* A4 aspect ratio approx */
    height: 297px;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.3s ease;
}

.dojo-document-mock:hover {
    transform: scale(1.02);
}

.doc-lines {
    padding: 30px;
}

.doc-line {
    height: 10px;
    background: #e0e0e0;
    margin-bottom: 15px;
    width: 100%;
    border-radius: 2px;
}

.doc-line.short {
    width: 40%;
}

.doc-line.medium {
    width: 70%;
}

.doc-ghost-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.1);
    font-weight: bold;
    font-size: 1.5rem;
    text-align: center;
    width: 80%;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@media (max-width: 850px) {
    .artifacts-container {
        flex-direction: column;
    }

    .artifacts-sidebar {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 1rem;
        padding-right: 0;
        margin-bottom: 1rem;
        /* Changed to ensure vertical stacking like Articles/Games */
        display: block;
        overflow-x: visible;
    }

    .artifact-nav-item {
        /* Full width for block display */
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1.25rem;
        /* Ensure normal wrapping */
        white-space: normal;
    }
}

/* Document Link Arrow */
.doc-link-arrow {
    position: absolute;
    top: 60px;
    left: 40px;
    width: 60px;
    height: 40px;
    border-top: 2px dashed var(--main-color);
    border-right: 2px dashed var(--main-color);
    border-radius: 0 50px 0 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0.7;
    animation: drawLink 2s infinite ease-in-out;
}

.doc-link-arrow::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--main-color);
}

@keyframes drawLink {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0.3;
    }

    50% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }

    100% {
        clip-path: inset(0 0 0 0);
        opacity: 0.3;
    }
}

/* Dojo Refactoring Visualization */
.dojo-refactor-viz {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.refactor-card {
    background: #0d1117;
    border: 1px solid #30363d;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    width: 200px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.refactor-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: #8b949e;
    text-transform: uppercase;
}

.refactor-arrow {
    font-size: 2rem;
    color: var(--main-color);
    animation: pulseArrow 2s infinite;
}

@keyframes pulseArrow {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Dojo Hotfix Visualization */
.dojo-hotfix-viz {
    position: relative;
    width: 300px;
    height: 150px;
    background: #222;
    border: 2px solid #ff4d4f;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 77, 79, 0.2);
}

.error-msg {
    color: #ff4d4f;
    font-weight: bold;
    font-size: 1.2rem;
    animation: shakeError 0.5s infinite;
    text-align: center;
}

.hotfix-tape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    background: #e0e0e0;
    color: #333;
    padding: 10px 40px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-left: 5px solid rgba(0, 0, 0, 0.1);
    border-right: 5px solid rgba(0, 0, 0, 0.1);
    animation: slapTape 2s infinite;
    /* Repeating to show the joke repeatedly */
    opacity: 0;
}

@keyframes shakeError {
    0% {
        transform: translate(1px, 1px);
    }

    10% {
        transform: translate(-1px, -2px);
    }

    20% {
        transform: translate(-3px, 0px);
    }

    30% {
        transform: translate(3px, 2px);
    }

    40% {
        transform: translate(1px, -1px);
    }

    50% {
        transform: translate(-1px, 2px);
    }

    60% {
        transform: translate(-3px, 1px);
    }

    70% {
        transform: translate(3px, 1px);
    }

    80% {
        transform: translate(-1px, -1px);
    }

    90% {
        transform: translate(1px, 2px);
    }

    100% {
        transform: translate(1px, -2px);
    }
}

@keyframes slapTape {

    0%,
    20% {
        opacity: 0;
        transform: translate(-50%, -150%) rotate(20deg) scale(2);
    }

    30%,
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-5deg) scale(1);
    }

    90%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-5deg) scale(1) translateY(10px);
    }
}

/* Trait Lists and Headers */
.traits-header {
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--main-color);
}

.traits-list {
    list-style-type: disc;
    padding-left: 20px;
    text-align: left;
    margin-bottom: 0;
}

/* Artifact Inline Style Cleanups */
.dojo-checkbox-container {
    width: 100%;
    max-width: 300px;
    border-top: none;
}

.dojo-doc-container {
    position: relative;
    width: 250px;
    height: 320px;
}

.dojo-document-mock.doc-bg {
    position: absolute;
    top: 20px;
    left: 40px;
    transform: rotate(5deg);
    z-index: 1;
}

.dojo-document-mock.doc-fg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.doc-link-line {
    background: var(--main-color);
    width: 30%;
    cursor: not-allowed;
}

.refactor-code-indent {
    padding-left: 10px;
}

/* --- Dojo Feature Demo --- */
.dojo-feature-demo {
    width: 100%;
    max-width: 400px;
}

.feature-card {
    background: #1a1f26;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.feature-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.feature-icon {
    font-size: 2rem;
    color: var(--main-color);
    margin-right: 15px;
}

.feature-title h4 {
    font-size: 1.1rem;
    margin: 0;
    color: #e6edf3;
}

.feature-title span {
    font-size: 0.8rem;
    color: #8b949e;
}

.p-bar-track {
    height: 10px;
    background: #0d1117;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.p-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--main-color), #8b5cf6);
    transition: width 0.2s linear;
}

.timer-text {
    font-size: 0.9rem;
    color: #8b949e;
    text-align: right;
    margin-bottom: 15px;
    font-family: monospace;
}

/* --- Dojo Requirement Demo --- */
.dojo-req-demo {
    width: 100%;
    max-width: 450px;
}

.req-paper {
    background: #fff;
    color: #333;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: rotate(-1deg);
    position: relative;
    transition: all 0.3s ease;
}

.req-paper:hover {
    transform: rotate(0deg) scale(1.01);
}

.req-heading {
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #444;
    font-weight: 700;
}

.req-text {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 80px;
    color: #111;
    /* Darker text */
    font-weight: 500;
    /* More visible */
}

.req-actions {
    text-align: right;
    border-top: 1px dashed #ccc;
    padding-top: 15px;
}

/* --- Dojo Acceptance Criteria Demo --- */
.dojo-ac-demo {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.ac-clipboard {
    background: #f0f0f0;
    color: #333;
    width: 100%;
    padding: 20px;
    border-radius: 6px 6px 4px 4px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    border-top: 8px solid #555;
    /* Clipboard clip */
}

.ac-header {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.ac-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: monospace;
}

.ac-item {
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #333;
    /* Ensure text is visible on light bg */
}

.ac-item i {
    color: #666;
}

.ac-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg) scale(0);
    border: 4px solid #e74c3c;
    color: #e74c3c;
    font-size: 2rem;
    font-weight: 900;
    padding: 10px 20px;
    text-transform: uppercase;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

.ac-stamp.visible {
    transform: translate(-50%, -50%) rotate(-15deg) scale(1);
    opacity: 0.9;
}