/* Wasteland terminal monitor frame */
.terminal-monitor-frame {
    background-color: #0a0a0a;
    border: 8px solid #8B4513;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(0, 0, 0, 0.8);
    margin: 0px 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.terminal-monitor-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.3) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.terminal-monitor-frame::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.1) 3px,
        rgba(0, 0, 0, 0) 3px
    );
    pointer-events: none;
    z-index: 2;
    animation: scan-line 10s linear infinite;
}

.terminal-monitor-header {
    background: linear-gradient(to right, #704214, #b87333, #704214);
    color: #FFD700;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #8B4513;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
}

.terminal-monitor-header .monitor-title {
    display: flex;
    align-items: center;
}

.terminal-monitor-header .monitor-title i {
    margin-right: 10px;
    color: #4caf50;
    animation: pulse 2s infinite;
}

.terminal-monitor-header .monitor-status {
    font-size: 0.8em;
    color: #4caf50;
    display: flex;
    align-items: center;
}

.terminal-monitor-header .monitor-status .status-indicator {
    width: 10px;
    height: 10px;
    background-color: #4caf50;
    border-radius: 50%;
    margin-right: 5px;
    animation: blink 2s infinite;
}

.terminal-monitor-content {
    color: #4caf50;
    font-family: 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    padding: 0;
    max-height: 100%;
    box-sizing: border-box;
}

.terminal-monitor-content.empty::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
}

/* Only show the waiting message when the terminal is empty */
.terminal-monitor-content.empty #wasteland-terminal::before {
    content: "WELCOME TO FERRUMIS | 24/7 DOCKING STATION";
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 3;
    font-size: 12px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Matrix-like text animation */
@keyframes matrix-text {
    0% { opacity: 0.3; text-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
    5% { opacity: 0.7; text-shadow: 0 0 8px rgba(0, 255, 0, 0.5); }
    10% { opacity: 0.3; text-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
    15% { opacity: 0.8; text-shadow: 0 0 10px rgba(0, 255, 0, 0.6); }
    20% { opacity: 0.4; text-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
    25% { opacity: 0.9; text-shadow: 0 0 12px rgba(0, 255, 0, 0.7); }
    30% { opacity: 0.5; text-shadow: 0 0 5px rgba(0, 255, 0, 0.3); }
    100% { opacity: 0.7; text-shadow: 0 0 8px rgba(0, 255, 0, 0.5); }
}

/* Matrix character animation */
.matrix-char {
    display: inline-block;
    animation: matrix-char-flicker 2s infinite;
    position: relative;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.matrix-char:nth-child(3n+1)::before {
    content: attr(data-char);
    position: absolute;
    left: 0;
    text-shadow: 2px 0 2px rgba(255, 0, 0, 0.7);
    animation: rgb-shift-red 0.1s infinite;
    opacity: 0.7;
}

.matrix-char:nth-child(3n+2)::after {
    content: attr(data-char);
    position: absolute;
    left: 0;
    text-shadow: -2px 0 2px rgba(0, 0, 255, 0.7);
    animation: rgb-shift-blue 0.1s infinite;
    opacity: 0.7;
}

@keyframes rgb-shift-red {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(1px); }
}

@keyframes rgb-shift-blue {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-1px); }
}

@keyframes matrix-char-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Glitch effect for the terminal */
.terminal-monitor-content.empty::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 0, 0.1) 50%,
        transparent 100%
    );
    animation: glitch-scan 2s linear infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes glitch-scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Prevent the card header title from changing color during glitch effects */
.card-header-title {
    color: #FFD700 !important;
    position: relative;
    z-index: 10;
}

/* File upload area enhancements to match terminal style */
.file-upload-area {
    border: 2px solid #8B4513 !important;
    background-color: #2a2a2a !important;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8) !important;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: #CD7F32 !important;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8) !important;
}

/* Wasteland Process Button */
.btn-wasteland {
    background: linear-gradient(to right, #704214, #b87333, #704214);
    color: #FFD700 !important;
    text-shadow: 1px 1px 2px #000, 0 0 5px #8B4513;
    border: 2px solid #8B4513;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.5);
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    font-weight: normal;
    border-radius: 0;
}

.btn-wasteland::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(139, 69, 19, 0.1) 10px, rgba(139, 69, 19, 0.1) 20px);
    pointer-events: none;
    z-index: 1;
}

.btn-wasteland::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: btn-wasteland-shine 4s infinite;
    z-index: 2;
}

.btn-wasteland:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.8), inset 0 0 15px rgba(0, 0, 0, 0.6);
    color: #FFF !important;
    text-shadow: 0 0 10px #FFD700;
}

@keyframes btn-wasteland-shine {
    0% { left: -50%; }
    100% { left: 150%; }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes scan-line {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

#wasteland-terminal {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
    overflow: hidden;
}

.terminal-message {
    font-family: 'Courier New', monospace;
    color: #4caf50;
    text-align: left;
    padding: 5px;
    white-space: pre-line;
    line-height: 1.2;
}

.terminal-message .message-header,
.terminal-message .message-footer {
    color: #8bc34a;
    font-size: 0.9em;
    opacity: 0.8;
    margin: 3px 0;
}

.terminal-message .message-body {
    margin: 8px 0;
    font-size: 1.1em;
}

.terminal-message .sender {
    color: #ffd700;
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

.terminal-monitor-content.empty #wasteland-terminal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: relative;
}

.matrix-message {
    display: inline-block;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    white-space: normal;
    word-wrap: break-word;
    margin: 0 auto;
    padding: 10px;
}