/*
 * admin.css — Custom styles for Mobile Minds Blog Admin
 *
 * Tailwind CSS (via CDN) handles the vast majority of styling.
 * This file contains only what Tailwind cannot easily express:
 *   - Flash message animations
 *   - EasyMDE integration overrides
 *   - Sidebar scrollbar styling
 *   - Miscellaneous utility overrides
 */

/* ============================================================================
   1. Flash message animations
   ========================================================================== */

@keyframes flash-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-message {
    animation: flash-slide-in 0.25s ease-out both;
}

/* ============================================================================
   2. Sidebar scrollbar — thin, dark-themed
   ========================================================================== */

/* Firefox */
nav {
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent; /* slate-700 thumb on transparent track */
}

/* WebKit */
nav::-webkit-scrollbar {
    width: 4px;
}

nav::-webkit-scrollbar-track {
    background: transparent;
}

nav::-webkit-scrollbar-thumb {
    background-color: #334155; /* slate-700 */
    border-radius: 9999px;
}

nav::-webkit-scrollbar-thumb:hover {
    background-color: #475569; /* slate-600 */
}

/* ============================================================================
   3. EasyMDE overrides
   ========================================================================== */

/* Ensure editor respects our font */
.CodeMirror,
.CodeMirror pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace,
                 'SFMono-Regular', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

/* Match toolbar to our slate palette */
.editor-toolbar {
    border-color: #cbd5e1 !important; /* slate-300 */
    background-color: #f8fafc !important; /* slate-50 */
    border-radius: 0.5rem 0.5rem 0 0;
}

.editor-toolbar a {
    color: #475569 !important; /* slate-600 */
    border-radius: 0.25rem;
}

.editor-toolbar a:hover,
.editor-toolbar a.active {
    background-color: #e2e8f0 !important; /* slate-200 */
    color: #1e293b !important; /* slate-800 */
    border-color: transparent !important;
}

.editor-toolbar i.separator {
    border-color: #cbd5e1 !important; /* slate-300 */
}

/* CodeMirror editor area */
.CodeMirror {
    border-color: #cbd5e1 !important; /* slate-300 */
    border-radius: 0 0 0.5rem 0.5rem;
    min-height: 420px;
    background-color: #ffffff;
}

/* Preview pane */
.editor-preview,
.editor-preview-side {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #1e293b; /* slate-800 */
}

.editor-preview h1 {
    color: #0f172a;
    font-weight: 800;
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.15;
}

.editor-preview h2 {
    color: #0f172a;
    font-weight: 700;
    font-size: 1.5em;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    line-height: 1.33;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #e2e8f0;
}

.editor-preview h3 {
    color: #0f172a;
    font-weight: 600;
    font-size: 1.25em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.editor-preview h4 {
    color: #1e293b;
    font-weight: 600;
    font-size: 1em;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
}

.editor-preview p {
    margin-bottom: 1em;
    line-height: 1.75;
}

.editor-preview a {
    color: #4f46e5;
    text-decoration: underline;
}

.editor-preview hr {
    border: none;
    border-top: 1px solid #cbd5e1;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.editor-preview blockquote {
    border-left: 4px solid #cbd5e1;
    padding-left: 1em;
    color: #475569;
    font-style: italic;
    margin-top: 1em;
    margin-bottom: 1em;
}

.editor-preview ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.editor-preview ol {
    list-style-type: decimal;
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.editor-preview li {
    margin-bottom: 0.25em;
}

.editor-preview code {
    background-color: #f1f5f9;
    color: #be185d;
    padding: 0.125em 0.375em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.editor-preview pre > code {
    background-color: #1e293b;
    color: #e2e8f0;
    display: block;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* EasyMDE fullscreen */
.CodeMirror-fullscreen,
.editor-toolbar.fullscreen,
.editor-preview-side.editor-preview-active-side {
    z-index: 60 !important;
}

/* ============================================================================
   4. General transitions
   ========================================================================== */

/* Smooth sidebar show/hide (supplement to Tailwind transition classes) */
#sidebar {
    will-change: transform;
}

/* Focus ring consistency across browsers */
:focus-visible {
    outline: 2px solid #6366f1; /* brand-500 */
    outline-offset: 2px;
}

/* ============================================================================
   5. Upload drop zone
   ========================================================================== */

.drop-zone {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.drop-zone.drag-over {
    background-color: #eef2ff; /* brand-50 */
    border-color: #6366f1;     /* brand-500 */
}

/* ============================================================================
   6. Status badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

.badge-published {
    background-color: #dcfce7; /* green-100 */
    color: #166534;            /* green-800 */
}

.badge-draft {
    background-color: #f1f5f9; /* slate-100 */
    color: #475569;            /* slate-600 */
}

.badge-scheduled {
    background-color: #fef9c3; /* yellow-100 */
    color: #854d0e;            /* yellow-800 */
}

/* ============================================================================
   7. Table overrides
   ========================================================================== */

.admin-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b; /* slate-500 */
}

.admin-table tbody tr {
    transition: background-color 0.1s ease;
}

.admin-table tbody tr:hover {
    background-color: #f8fafc; /* slate-50 */
}

/* ============================================================================
   8. Prose / Typography — preview & rendered content
   ========================================================================== */

.prose h1 {
    font-size: 2.25em;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 0.9em;
    color: #0f172a; /* slate-900 */
}

.prose h2 {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.33;
    margin-top: 2em;
    margin-bottom: 1em;
    color: #0f172a;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #e2e8f0; /* slate-200 */
}

.prose h3 {
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    color: #0f172a;
}

.prose h4 {
    font-size: 1em;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1e293b; /* slate-800 */
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose a {
    color: #4f46e5; /* brand-600 */
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.prose a:hover {
    color: #4338ca; /* brand-700 */
}

.prose strong {
    font-weight: 700;
    color: #0f172a;
}

.prose hr {
    border: none;
    border-top: 1px solid #cbd5e1; /* slate-300 */
    margin-top: 2em;
    margin-bottom: 2em;
}

.prose blockquote {
    border-left: 4px solid #cbd5e1;
    padding-left: 1em;
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    color: #475569; /* slate-600 */
    font-style: italic;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.625em;
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.625em;
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose code {
    background-color: #f1f5f9; /* slate-100 */
    color: #be185d; /* pink-700 */
    padding: 0.125em 0.375em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose pre {
    background-color: #1e293b; /* slate-800 */
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-top: 1.75em;
    margin-bottom: 1.75em;
    overflow-x: auto;
}

.prose pre code {
    background-color: transparent;
    color: #e2e8f0; /* slate-200 */
    padding: 0;
    border-radius: 0;
    font-size: 0.875em;
}

.prose img {
    border-radius: 0.5rem;
    margin-top: 2em;
    margin-bottom: 2em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
}

.prose thead th {
    border-bottom: 2px solid #cbd5e1;
    padding: 0.5em 0.75em;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
}

.prose tbody td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5em 0.75em;
}

/* ============================================================================
   9. Print — hide admin chrome
   ========================================================================== */

@media print {
    #sidebar,
    #sidebar-overlay,
    header,
    #flash-container {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }
}
