/* assets/style.css */
:root {
    /* Color Palette (Professional SaaS Blue-Grey) */
    --primary: #2563eb;       /* Brand Blue */
    --primary-hover: #1d4ed8;
    --success: #10b981;       /* Action Green */
    --success-hover: #059669;
    --danger: #ef4444;        /* Delete Red */
    --text-main: #1e293b;     /* Slate 800 */
    --text-light: #64748b;    /* Slate 500 */
    --bg-app: #f1f5f9;        /* Light Gray Background */
    --bg-surface: #ffffff;    /* White Cards */
    --border: #e2e8f0;        /* Subtle Borders */
    
    /* Spacing & Radius */
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* --- Global Reset & Typography --- */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout Containers --- */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.editor-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.025em; color: var(--text-main); }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }
p { color: var(--text-light); }

/* --- Components: Cards --- */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    border: 1px solid var(--border);
}

/* --- Components: Buttons --- */
button { font-family: inherit; }
.btn-primary, .btn-success, .btn-danger, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; width: 100%; margin-top: 1rem; }
.btn-success:hover { background: var(--success-hover); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; background: #fee2e2; color: var(--danger); }
.btn-sm:hover { background: var(--danger); color: white; }

/* --- Upload Area (Hero UX) --- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #f8fafc;
}
.upload-area:hover { border-color: var(--primary); background: #eff6ff; }
.upload-placeholder .icon { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.5; }
.preview-img { max-width: 100%; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }

/* --- Modern Tables --- */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 20px 0;
}
table { width: 100%; border-collapse: collapse; background: white; font-size: 0.95rem; }
th { background: #f8fafc; color: var(--text-light); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-main); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* --- Form Inputs --- */
input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: 0.2s;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Editor Split Screen --- */
.editor-sidebar {
    width: 35%;
    background: #0f172a; /* Dark Slate for contrast */
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.editor-sidebar h3 { color: #94a3b8; margin-bottom: 20px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; width: 100%; }
.editor-content { flex: 1; padding: 40px; overflow-y: auto; background: var(--bg-app); }

.sticky-image { position: sticky; top: 20px; width: 100%; }
.sticky-image img { width: 100%; border-radius: var(--radius-md); box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5); border: 1px solid #334155; }

/* --- Utility Classes --- */
.hidden { display: none !important; }
.content-header { margin-bottom: 24px; }
.hint { font-size: 0.85rem; color: var(--text-light); margin-top: 8px; text-align: center; }

/* --- Custom Toast Notification --- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Loader Animation --- */
.spinner {
    width: 50px; height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loader { text-align: center; padding: 40px; color: var(--text-light); }