/* Wanix-Tor Shell Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f1a;
    color: #eee;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #333;
    margin-bottom: 1rem;
}

#header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #9d4edd;
}

#status {
    font-size: 0.875rem;
    color: #888;
    padding: 0.25rem 0.75rem;
    background: #1a1a2e;
    border-radius: 4px;
}

#terminal {
    flex: 1;
    min-height: 400px;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
}

/* xterm.js overrides */
.xterm {
    padding: 0.5rem;
}

.xterm-viewport {
    overflow-y: auto !important;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#status.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ── Tor Status Widget ───────────────────────────────────────────────── */

.tsw {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: default;
    user-select: none;
    background: #1a1a2e;
    border: 1px solid #333;
    transition: border-color 0.2s;
}

.tsw:hover { border-color: #555; }

.tsw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
}

.tsw-idle .tsw-dot    { background: #555; }
.tsw-connecting .tsw-dot { background: #f0a500; animation: tsw-pulse 1s ease-in-out infinite; }
.tsw-bootstrapping .tsw-dot { background: #4fa3e3; animation: tsw-pulse 0.8s ease-in-out infinite; }
.tsw-connected .tsw-dot { background: #4caf50; }
.tsw-error .tsw-dot   { background: #e74c3c; }

@keyframes tsw-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.tsw-label { color: #ccc; white-space: nowrap; }

.tsw-connected .tsw-label { color: #4caf50; }
.tsw-error .tsw-label     { color: #e74c3c; }

.tsw-refresh {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.1rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, transform 0.15s;
}

.tsw-refresh:hover  { color: #ccc; transform: rotate(45deg); }
.tsw-refresh:active { transform: rotate(180deg); }
.tsw-refresh:disabled { opacity: 0.4; cursor: default; }

.tsw-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #252535;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #ccc;
    white-space: pre;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-width: 180px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

/* Responsive */
@media (max-width: 768px) {
    #container {
        padding: 0.5rem;
    }

    #header h1 {
        font-size: 1.25rem;
    }

    #terminal {
        min-height: 300px;
    }
}
