:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Mesh Gradient */
.background-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.mesh-blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}
.blob-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, rgba(0,0,0,0) 70%);
    top: -200px; left: -100px;
}
.blob-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(56,189,248,0.2) 0%, rgba(0,0,0,0) 70%);
    bottom: -100px; right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}
header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #a78bfa, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}
.btn-icon {
    font-size: 1.2rem;
    padding: 0.5rem 0.75rem;
}
.btn-icon.active {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

/* Utilities */
.hidden { display: none !important; }

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Formatting */
.result-block h2 {
    font-size: 1.2rem;
    color: #a78bfa;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rules-list, .recommendations-list {
    list-style-type: none;
    padding-left: 0;
}
.rules-list li, .recommendations-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
}
.rules-list li::before {
    content: "✔️";
    position: absolute;
    left: 0; top: 2px;
    font-size: 0.9rem;
}
.recommendations-list li::before {
    content: "👉";
    position: absolute;
    left: 0; top: 2px;
    font-size: 0.9rem;
}

.corrections-grid {
    display: grid;
    gap: 1rem;
}
.correction-item {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}
.corr-fragment { color: #fca5a5; font-style: italic; margin-bottom: 0.5rem;}
.corr-mejora { font-weight: 500; margin-bottom: 0.25rem;}
.corr-motivo { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.25rem;}
.corr-hecho { color: #6ee7b7; font-size: 0.95rem; margin-top: 0.5rem;}
.corr-guia { display: inline-block; background: rgba(139,92,246,0.2); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; margin-top: 0.5rem; color: #c4b5fd;}

.final-correction {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(145deg, rgba(30,41,59,0.7) 0%, rgba(16,185,129,0.05) 100%);
}
.suggested-text {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}
.btn-copy {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-copy:hover {
    background: rgba(255,255,255,0.2);
}

.feedback-section {
    border-color: rgba(56, 189, 248, 0.3);
}
.feedback-actions {
    display: flex;
    gap: 0.5rem;
}
.success-msg {
    color: var(--success);
    margin-top: 1rem;
    font-size: 0.95rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.5s ease forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}
