:root {
    --primary: #2e7d32;
    --secondary: #4caf50;
    --bg-dark: #121212;
    --card-bg: rgba(30, 30, 30, 0.8);
    --text-light: #e0e0e0;
    --accent: #81c784;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: var(--text-light);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 90%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #444;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-badge.online { background: rgba(76, 175, 80, 0.2); color: #4caf50; }
.status-badge.offline { background: rgba(244, 67, 54, 0.2); color: #f44336; }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

textarea {
    width: 100%;
    height: 150px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    padding: 1rem;
    box-sizing: border-box;
    resize: vertical;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

textarea:focus { outline: none; border-color: var(--secondary); }

button {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

button:hover { background: var(--secondary); }
button:active { transform: scale(0.98); }
button:disabled { background: #555; cursor: not-allowed; }

.response-area {
    margin-top: 1.5rem;
    background: #000;
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    display: none;
    border-left: 4px solid var(--primary);
    overflow-x: auto;
}

.response-area.error { border-left-color: #f44336; }

input[type="number"],
input[type="password"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--text-light);
    padding: 1rem;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s;
    margin-bottom: 1rem;
    text-align: center;
}

input[type="number"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary);
}

.command-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-btn {
    flex-grow: 1;
    width: auto;
    margin-top: 0;
}

.stop-btn {
    background: #c62828;
}

.stop-btn:hover {
    background: #e53935;
}

/* Modal e Histórico */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1e1e1e;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    border: 1px solid #333;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--accent);
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: auto;
    margin: 0;
}

.history-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-info {
    display: flex;
    flex-direction: column;
}

.history-item-time {
    font-size: 0.75rem;
    color: #777;
}

/* Scrollbar Style */
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}