/* Terminal container styles */
.terminal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 600px;
    height: 400px;
    background-color: rgba(10, 25, 47, 0.98);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--secondary-color);
    padding: 15px;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.terminal-container.show {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--secondary-color);
    margin-bottom: 10px;
    flex-shrink: 0;
}

.terminal-title {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.terminal-close {
    padding: 8px 12px !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    color: var(--secondary-color);
}

.terminal-close:hover {
    color: var(--hover-color);
}

.terminal-toggle {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 50px !important;
    height: 50px !important;
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    z-index: 9999 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(100, 255, 218, 0.3) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.terminal-toggle:hover,
.terminal-toggle:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(100, 255, 218, 0.4) !important;
    outline: none !important;
}

.terminal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.terminal-input-line {
    display: flex;
    padding: 10px 0;
    position: sticky;
    bottom: 0;
    background-color: rgba(10, 25, 47, 0.98);
    z-index: 2;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.terminal-prompt {
    color: var(--highlight-color);
    margin-right: 10px;
}

.terminal-input {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
    z-index: 2;
}

.terminal-output {
    color: var(--text-color);
    margin-bottom: 10px;
    white-space: pre-wrap;
    transition: opacity 0.2s ease;
    line-height: 1.4;
}

.terminal-output.error {
    color: #ff6b6b;
}

.terminal-output.success {
    color: var(--highlight-color);
}

.terminal-output.command {
    color: var(--secondary-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .terminal-container {
        width: calc(100% - 40px) !important;
        left: 20px !important;
        right: 20px !important;
        max-width: 600px !important;
        margin: 0 auto !important;
        border-radius: 12px !important;
        height: 70vh !important;
        bottom: 0 !important;
        transform: translateY(100%);
    }

    .terminal-container.show {
        transform: translateY(0);
    }

    .terminal-content {
        font-size: 15px;
        padding: 10px 5px;
        height: calc(70vh - 120px);
    }

    .terminal-input {
        font-size: 16px;
        padding: 8px 0;
        width: 100%;
        -webkit-appearance: none;
    }

    .terminal-toggle {
        bottom: 25px !important;
        right: 25px !important;
        width: 55px !important;
        height: 55px !important;
        font-size: 22px !important;
    }
}

@media (max-width: 480px) {
    .terminal-container {
        height: 80vh !important;
        padding: 12px !important;
    }

    .terminal-content {
        height: calc(80vh - 100px);
        font-size: 14px;
        padding: 8px 4px;
    }

    .terminal-toggle {
        bottom: 20px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }

    .terminal-title {
        font-size: 13px;
    }

    .terminal-close {
        padding: 6px 10px !important;
    }
}

@supports (-webkit-touch-callout: none) {
    .terminal-container {
        height: -webkit-fill-available !important;
        padding-bottom: calc(env(safe-area-inset-bottom) + 15px) !important;
    }

    .terminal-toggle {
        bottom: max(20px, env(safe-area-inset-bottom)) !important;
    }
}
