/* Terminal Search Styles */
.terminal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 60%;
    max-height: 500px;
    background: #000;
    border: 2px solid #B22222;
    box-shadow: 0 0 20px #B22222, inset 0 0 10px rgba(178, 34, 34, 0.3);
    z-index: 10000;
    font-family: 'Broken Console Bold', 'Courier New', monospace;
    display: none;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    cursor: url('images/redrighthand.png'), auto;
}

/* Search button styles */
.search-btn {
    background-color: #B22222;
    color: #000;
    border: none;
    padding: 6px 12px;
    margin-right: 10px;
    font-family: 'Broken Console Bold', 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.search-btn i {
    margin-right: 6px;
}

.search-btn:hover {
    background-color: #8B0000;
    color: #fff;
}

.search-btn:focus {
    outline: 2px solid #ff0000;
    outline-offset: 2px;
}

.terminal-container.dragging {
    transition: none;
    box-shadow: 0 0 30px #B22222, inset 0 0 15px rgba(178, 34, 34, 0.5);
}

.terminal-header {
    background: linear-gradient(90deg, #B22222, #8B0000);
    color: #000;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

.terminal-close {
    background: none;
    border: none;
    color: #000;
    font-size: 20px;
    cursor: url(images/redrighthand.png), pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.terminal-output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #000;
    color: #00ff00;
    font-size: 14px;
    line-height: 1.4;
    max-height: calc(100% - 90px);
    min-height: 100px;
    scroll-behavior: smooth;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.terminal-suggestions {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid #B22222;
    border-radius: 5px;
    overflow-y: auto;
    display: none;
    z-index: 10001;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(178, 34, 34, 0.2);
    color: #00ff00;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: rgba(178, 34, 34, 0.2);
}

.suggestion-desc {
    color: rgba(0, 255, 0, 0.6);
    font-size: 0.9em;
    margin-left: 20px;
}

.terminal-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(178, 34, 34, 0.3);
    pointer-events: none;
    animation: scanline 6s linear infinite;
    opacity: 0.5;
    z-index: 10002;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.terminal-input-line {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #111;
    border-top: 1px solid #B22222;
}

.terminal-prompt {
    color: #B22222;
    font-weight: bold;
    margin-right: 8px;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Broken Console Bold', 'Courier New', monospace;
    font-size: 14px;
    outline: none;
}

.terminal-input::placeholder {
    color: #666;
    opacity: 0.7;
}

/* Animated placeholder styles */
.terminal-input.animated-placeholder::placeholder {
    animation: typewriter 3s steps(20) infinite, blink 1s infinite;
}

@keyframes typewriter {
    0% { content: ""; }
    5% { content: "T"; }
    10% { content: "Ty"; }
    15% { content: "Typ"; }
    20% { content: "Type"; }
    25% { content: "Type "; }
    30% { content: "Type h"; }
    35% { content: "Type he"; }
    40% { content: "Type her"; }
    45% { content: "Type here"; }
    50% { content: "Type here"; }
    55% { content: "Type her"; }
    60% { content: "Type he"; }
    65% { content: "Type h"; }
    70% { content: "Type "; }
    75% { content: "Type"; }
    80% { content: "Typ"; }
    85% { content: "Ty"; }
    90% { content: "T"; }
    95% { content: ""; }
    100% { content: ""; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Alternative subtle pulse animation */
.terminal-input.pulse-placeholder::placeholder {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Typewriter text animation for placeholder */
.terminal-input-container {
    position: relative;
}

.terminal-placeholder-animation {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.7;
    font-family: 'Broken Console Bold', 'Courier New', monospace;
}

.terminal-placeholder-animation span {
    display: inline-block;
    animation: typewriter-letter 0.1s ease-in-out forwards;
    opacity: 0;
}

@keyframes typewriter-letter {
    to {
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.terminal-placeholder-fade {
    animation: fadeInOut 2s ease-in-out infinite;
}

.terminal-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-line.error {
    color: #ff0040;
}

.terminal-line.success {
    color: #00ff88;
}

.terminal-line.info {
    color: #00aaff;
}

.terminal-line.warning {
    color: #ffd700;
}

/* Terminal scrollbar */
.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #000;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #B22222;
    border-radius: 4px;
}

/* Terminal animation */
@keyframes terminalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.terminal-container.show {
    display: flex;
    animation: terminalFadeIn 0.3s ease-out;
}

/* Terminal cursor */
.terminal-input:focus {
    caret-color: #00ff00;
}

/* Responsive terminal */
@media (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 70%;
        max-height: none;
    }
    
    .terminal-header {
        font-size: 12px;
    }
    
    .terminal-output,
    .terminal-input {
        font-size: 12px;
    }
}
