/* ===================================
   ENGINEERED FEATURES (Upgrades 1-4)
   =================================== */

/* -----------------------------------
   1. PROOF PANEL (Under Hero)
   ----------------------------------- */
.proof-panel {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
    animation: fadeIn 0.8s ease-out 0.5s backwards;
}

.proof-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-family: 'Courier New', monospace;
    /* Tech feel */
    color: var(--text-secondary);
    transition: transform 0.2s, background 0.2s;
}

.proof-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.proof-item i {
    font-size: 1.1em;
}

/* -----------------------------------
   2. SYSTEMS I BUILT (Section)
   ----------------------------------- */
#systems {
    padding: var(--space-xl) 0;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    position: relative;
    /* Border to separate from projects */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.system-card {
    background: var(--bg-card);
    border: 1px solid rgba(126, 59, 237, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.system-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.system-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.system-card:hover::before {
    opacity: 1;
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.system-title {
    font-size: var(--text-lg);
    color: var(--text-primary);
    margin: 0;
}

.system-icon {
    color: var(--primary-light);
    font-size: 1.2rem;
}

.system-desc {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.system-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-tertiary);
    font-family: monospace;
}

/* -----------------------------------
   3. CASE STUDY MODAL
   ----------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1a1a1f;
    border: 2px solid var(--primary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(126, 59, 237, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(90deg, rgba(126, 59, 237, 0.15) 0%, rgba(126, 59, 237, 0.05) 100%);
    padding: var(--space-lg);
    border-bottom: 2px solid rgba(126, 59, 237, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: #1a1a1f;
    /* Sticky needs opaque bg - match modal content */
    z-index: 10;
}

.modal-title-group h2 {
    font-size: var(--text-2xl);
    margin-bottom: 4px;
    color: #ffffff;
    /* Pure white for maximum visibility */
    font-weight: 700;
}

.modal-role {
    color: var(--primary-light);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--error);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: var(--space-lg);
}

.case-grid {
    display: grid;
    gap: var(--space-lg);
}

.case-section {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.case-section h3 {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.95);
    /* Brighter headings */
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.case-section h3 i {
    color: var(--primary);
}

.case-text {
    color: rgba(255, 255, 255, 0.85);
    /* Brighter text for better readability */
    font-size: var(--text-base);
    line-height: 1.7;
}

.tech-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.tech-badge {
    background: rgba(126, 59, 237, 0.1);
    color: var(--primary-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: var(--text-sm);
    border: 1px solid rgba(126, 59, 237, 0.2);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* -----------------------------------
   4. TERMINAL WIDGET (Overrides)
   ----------------------------------- */
.terminal-body {
    /* Ensure it can scroll */
    max-height: 300px;
    /* Limit height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', monospace;
    /* Monospace font */
    font-size: 0.9rem;
    cursor: text;
    /* Indicate interactive */
    /* FIX: Bring above glow */
    position: relative;
    z-index: 10;
}

/* Scrollbar for terminal */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.terminal-output {
    flex-grow: 1;
    /* Push input to bottom */
    margin-bottom: 10px;
}

.terminal-line {
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-all;
}

.terminal-line.success {
    color: #4caf50;
}

.terminal-line.error {
    color: #f44336;
}

.terminal-line.info {
    color: #2196f3;
}

.terminal-line.cmd {
    color: #aaa;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    color: #fff;
}

.terminal-prompt {
    color: var(--success);
    margin-right: 8px;
    font-weight: bold;
}

#terminalInput {
    background: transparent;
    border: none;
    color: #fff;
    flex-grow: 1;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: var(--success);
    /* Blinking cursor color */
}

/* Hide play button in hero to avoid clutter */
/* Or adjust styling */

/* 5. SPECIFIC BUTTON STYLES */
.view-case-study-btn {
    background: rgba(126, 59, 237, 0.2);
    border: 1px solid var(--primary);
    color: #fff;
    margin-left: 5px;
    /* Spacing from other buttons */
}

.view-case-study-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary);
}