:root {
    --color-highlight: #00aea5;
    --color-bg-main: #003c46;
    --color-bg-card: #161f28;
    --color-text: #f2f1f0;
    --color-text-muted: #8a9a9c;
    --color-error: #ef4444;
    --color-success: #22c55e;
    
    --font-title: 'Wix Madefor Display', sans-serif;
    --font-text: 'Wix Madefor Text', sans-serif;
}

body {
    background-color: var(--color-bg-main);
    color: var(--color-text);
    font-family: var(--font-text);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    margin-top: 0;
}

a {
    color: var(--color-highlight);
    text-decoration: none;
}

button {
    font-family: var(--font-title);
    cursor: pointer;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

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

.title {
    color: var(--color-highlight);
    font-size: 2rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    background-color: var(--color-highlight);
    border: none;
    color: var(--color-bg-card);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-highlight);
    color: var(--color-highlight);
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Instance Grid */
.instance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Confirm Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.confirm-modal {
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 450px;
    width: calc(100% - 2rem);
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-header {
    margin-bottom: 1.5rem;
}

.confirm-header h3 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--color-text);
}

.confirm-body {
    margin-bottom: 2rem;
}

.confirm-body p {
    margin: 0;
    color: var(--color-text-muted);
    line-height: 1.6;
    font-size: 1rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.confirm-actions button {
    min-width: 100px;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

.btn-primary:hover:not(:disabled) {
    background: #00c9be;
}

.card {
    background-color: var(--color-bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.instance-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: rgba(255,255,255,0.1);
}

.status-connected { background-color: var(--color-success); color: white; }
.status-disconnected { background-color: var(--color-error); color: white; }
.status-connecting { background-color: #eab308; color: black; }
.status-created { background-color: var(--color-text-muted); color: var(--color-bg-card); }
.status-pending { background-color: #f97316; color: white; }

.instance-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-family: var(--font-text);
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--color-highlight);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: var(--color-bg-card);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-title);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary:hover:not(:disabled) {
    background: #00c9be;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.loading-container p {
    margin-top: 1.5rem;
    font-size: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 174, 165, 0.2);
    border-top-color: var(--color-highlight);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}
.qr-container img {
    max-width: 100%;
}

.webhook-info {
    font-size: 0.9rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 6px;
    word-break: break-all;
    font-family: monospace;
    margin-top: 1rem;
    border: 1px solid var(--color-highlight);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.section-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-highlight);
}
