/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 {
    color: #34495e;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Health Status */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #bdc3c7;
}

.health-item.healthy {
    border-left-color: #27ae60;
}

.health-item.healthy i {
    color: #27ae60;
}

.health-item.warning {
    border-left-color: #f39c12;
}

.health-item.warning i {
    color: #f39c12;
}

.health-item.unhealthy {
    border-left-color: #e74c3c;
}

.health-item.unhealthy i {
    color: #e74c3c;
}

.health-item .status {
    margin-left: auto;
    font-weight: 500;
    font-size: 12px;
}

/* Server Grid */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.server-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #bdc3c7;
}

.server-card.provisioning {
    border-left-color: #f39c12;
}

.server-card.running {
    border-left-color: #27ae60;
}

.server-card.stopped {
    border-left-color: #e74c3c;
}

.server-card.completed {
    border-left-color: #9b59b6;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.server-id {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.server-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #ecf0f1;
    color: #7f8c8d;
}

.server-info {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.server-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.server-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
}

/* Status indicators */
.status {
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.status.connected {
    background: #d5f4e6;
    color: #27ae60;
}

.status.disconnected {
    background: #fadbd8;
    color: #e74c3c;
}

/* Log Output */
.log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    margin: 0;
}

.log-output {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-entry {
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-timestamp {
    color: #95a5a6;
    margin-right: 10px;
}

.log-level-info {
    color: #3498db;
}

.log-level-success {
    color: #27ae60;
}

.log-level-warning {
    color: #f39c12;
}

.log-level-error {
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .health-grid {
        grid-template-columns: 1fr;
    }
    
    .servers-grid {
        grid-template-columns: 1fr;
    }
    
    .server-actions {
        justify-content: center;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}