* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: auto;
}

header {
    text-align: center;
    padding: 25px;
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    margin-bottom: 30px;
}

.subtitle {
    opacity: 0.8;
}

.input-section,
.result-section,
.error-section {
    background: #ffffff;
    color: #111;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 25px 40px rgba(0,0,0,0.3);
}

label {
    font-weight: bold;
}

input {
    width: 100%;
    padding: 14px;
    margin: 10px 0 15px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

button {
    padding: 14px 20px;
    background: linear-gradient(to right, #2563eb, #1e40af);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.loading {
    display: none;
    text-align: center;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 5px solid #ddd;
    border-top: 5px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
}

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

/* ---------- Code Preview ---------- */
.source-code {
    background: #0f172a;
    color: #e5e7eb;
    padding: 25px;
    margin-top: 15px;
    max-height: 500px;
    overflow: auto;
    border-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Syntax colors */
.tag { color: #38bdf8; }
.attr { color: #fbbf24; }
.value { color: #4ade80; }
.comment { color: #94a3b8; font-style: italic; }

.actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.actions button {
    flex: 1;
}

.error-section {
    display: none;
    background: #fee2e2;
    color: #991b1b;
}

footer {
    text-align: center;
    opacity: 0.7;
    margin-top: 20px;
}