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

:root {
    --primary: #00AA00;
    --secondary: #555;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333;
    --border: #ddd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

small {
    display: block;
    margin-top: 5px;
    color: var(--secondary);
    font-size: 0.875rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #009900;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: #444;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.progress-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--primary);
}

.progress-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.progress-logs {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

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

.log-entry.step {
    color: var(--primary);
    font-weight: bold;
}

.log-entry.error {
    color: var(--danger);
}

.log-entry.complete {
    color: var(--success);
    font-weight: bold;
    font-size: 1.1rem;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-top: 10px;
}

.hidden {
    display: none;
}

.instances-list {
    display: grid;
    gap: 15px;
}

.instance-card {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s;
}

.instance-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.instance-domain {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

.instance-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-running {
    background: #d4edda;
    color: #155724;
}

.status-pending-setup {
    background: #fff3cd;
    color: #856404;
}

.status-installed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-config-only {
    background: #f8d7da;
    color: #721c24;
}

.status-unknown {
    background: #e2e3e5;
    color: #383d41;
}

.instance-info {
    margin-top: 10px;
    color: var(--secondary);
    font-size: 0.9rem;
}

.instance-url {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.instance-url:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--secondary);
}

footer {
    text-align: center;
    padding: 30px 0;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

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

.modal-body {
    padding: 20px;
}

.config-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.config-group h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--text);
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.config-label {
    font-weight: 500;
    color: var(--secondary);
}

.config-value {
    font-family: 'Courier New', monospace;
    color: var(--text);
    word-break: break-all;
}

.btn-config {
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-config:hover {
    background: #009900;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .instance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
