/* Terminal CSS - Красивий термінал */

/* Terminal header */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-main);
    padding: 0;
    height: 25px;
    flex-shrink: 0;
}

.terminal-tabs {
    display: flex;
    height: 100%;
}

.terminal-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    border-right: 1px solid var(--border-main);
    transition: background-color 0.2s;
}

.terminal-tab.active {
    background: var(--bg-base);
    color: var(--text-bright);
}

.terminal-tab:hover {
    background: var(--bg-hover);
}

.terminal-actions {
    padding: 0 8px;
    display: flex;
    gap: 4px;
}

.terminal-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}

/* КРАСИВИЙ ТЕРМІНАЛ КОНТЕНТ */
.terminal-content {
    flex: 1;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-y: auto;
    background: linear-gradient(135deg, var(--bg-deepest) 0%, var(--bg-deep) 100%);
    color: var(--text-soft);
    border: 1px solid var(--border-dim);
    border-radius: 0 0 4px 4px;
}

.terminal-welcome {
    color: #00d4aa;
    margin-bottom: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 8px;
    text-shadow: 0 0 4px rgba(0, 212, 170, 0.3);
}

.terminal-log {
    margin-bottom: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(2px);
    transition: all 0.2s ease;
}

.terminal-log:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.terminal-error {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
    border-left-color: var(--danger);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15);
}

.terminal-success {
    color: var(--success-alt);
    background: rgba(81, 207, 102, 0.1);
    border-left-color: var(--success-alt);
    box-shadow: 0 2px 8px rgba(81, 207, 102, 0.15);
}

.terminal-info {
    color: var(--accent-light);
    background: rgba(116, 192, 252, 0.1);
    border-left-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(116, 192, 252, 0.15);
}

.terminal-warning {
    color: var(--warning);
    background: rgba(255, 212, 59, 0.1);
    border-left-color: var(--warning);
    box-shadow: 0 2px 8px rgba(255, 212, 59, 0.15);
}

/* Красиві посилання в терміналі */
.terminal-log a {
    color: #00d4aa;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    margin-left: 4px;
}

.terminal-log a:hover {
    background: rgba(0, 212, 170, 0.2);
    border-color: #00d4aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
    text-shadow: 0 0 4px rgba(0, 212, 170, 0.5);
}

.terminal-log a:before {
    content: "🔗";
    font-size: 10px;
}

/* Timestamp styling */
.terminal-log span[style*="opacity"] {
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 400;
    margin-right: 8px;
    background: rgba(102, 102, 102, 0.1);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Спеціальні іконки для типів логів */
.terminal-success:before {
    content: "✅ ";
    margin-right: 4px;
}

.terminal-error:before {
    content: "❌ ";
    margin-right: 4px;
}

.terminal-info:before {
    content: "ℹ️ ";
    margin-right: 4px;
}

.terminal-warning:before {
    content: "⚠️ ";
    margin-right: 4px;
}

/* Hash та адреси */
.terminal-log code, 
.terminal-log .hash {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar для терміналу */
.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: var(--bg-deepest);
    border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00d4aa, var(--accent));
    border-radius: 4px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #00e6c0, #0088ff);
}

/* Mobile: the terminal gets a bigger share of the screen, so the log rows
   themselves have to give the padding back. Font size is deliberately left
   alone — it is a user setting applied inline by settings.js. */
@media (max-width: 950px) {
    .terminal-header {
        height: 32px;
    }

    .terminal-content {
        padding: 8px;
    }

    .terminal-log {
        margin-bottom: 4px;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .terminal-welcome {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .terminal-log span[style*="opacity"] {
        margin-right: 4px;
    }

    .terminal-log a {
        margin-left: 2px;
        padding: 1px 4px;
    }

    /* 32px is the smallest comfortable tap target for the clear button */
    .terminal-btn {
        min-width: 32px;
        min-height: 32px;
    }

    .terminal-content::-webkit-scrollbar {
        width: 5px;
    }
}