/**
 * RetireWise USA - Admin Dashboard Styles
 * Typography: 'Urbanist' for Body, 'Barlow Semi Condensed' for Headings
 */

body {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4, h5, h6, .admin-brand, .metric-num {
    font-family: 'Barlow Semi Condensed', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.02em;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f1f5f9;
}

.admin-sidebar {
    width: 260px;
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-brand {
    padding: 1.5rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.admin-nav {
    padding: 1rem 0;
    flex: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.admin-nav-item:hover, .admin-nav-item.active {
    color: #ffffff;
    background-color: #1e293b;
    border-left: 4px solid #10b981;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.admin-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* Stat Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-metric-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.metric-num {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.25rem;
    line-height: 1;
}

/* Data Tables */
.data-table-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 0.95rem;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
}

.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-info { background-color: #e0f2fe; color: #0369a1; }
.badge-danger { background-color: #fee2e2; color: #b91c1c; }

/* Editor Forms */
.form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.editor-textarea {
    min-height: 280px;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================================
   GUTENBERG / ELEMENTOR STYLE VISUAL BLOCK EDITOR
============================================================ */
.visual-builder-wrapper {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.builder-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.builder-tabs {
    display: flex;
    gap: 0.5rem;
}

.builder-tab-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.builder-tab-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.builder-canvas {
    padding: 1.5rem;
    min-height: 420px;
    background: #ffffff;
}

/* Visual Block Item */
.g-block {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g-block:hover, .g-block:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px #38bdf8;
}

.g-block-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.775rem;
    color: #64748b;
}

.g-block-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0f172a;
}

.g-block-actions {
    display: flex;
    gap: 0.35rem;
}

.g-btn-icon {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s ease;
}

.g-btn-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.g-btn-icon.delete:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Block Inputs */
.g-input-text {
    width: 100%;
    border: 1px solid transparent;
    padding: 0.4rem 0.25rem;
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.6;
    border-radius: 4px;
    outline: none;
    resize: vertical;
    min-height: 70px;
}

.g-input-text:focus {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.g-input-heading {
    width: 100%;
    border: 1px solid transparent;
    padding: 0.4rem 0.25rem;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.45rem;
    outline: none;
    border-radius: 4px;
}

.g-input-heading:focus {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* Add Block Selector Panel */
.add-block-panel {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    background: #f8fafc;
    margin-top: 1rem;
}

.add-block-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.btn-add-block {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-add-block:hover {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
    transform: translateY(-1px);
}

/* ============================================================
   RANKMATH STYLE SEO ANALYSIS and LIVE SERP PREVIEW
============================================================ */
.rankmath-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    overflow: hidden;
}

.rankmath-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.rankmath-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.rankmath-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f59e0b;
    color: #0f172a;
    font-weight: 900;
    border-radius: 6px;
    font-size: 1rem;
}

.rankmath-score-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.2);
}

.score-number {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'Barlow Semi Condensed', sans-serif;
}

.score-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.score-great { background-color: #10b981; color: #ffffff; }
.score-fair { background-color: #f59e0b; color: #0f172a; }
.score-poor { background-color: #ef4444; color: #ffffff; }

.rankmath-body {
    padding: 1.5rem;
}

/* Live Google SERP Snippet Preview */
.google-preview-card {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    font-family: arial, sans-serif;
}

.serp-url-breadcrumb {
    font-size: 0.85rem;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.serp-favicon {
    width: 18px;
    height: 18px;
    background: #059669;
    border-radius: 50%;
    display: inline-block;
    color: #fff;
    font-size: 10px;
    text-align: center;
    line-height: 18px;
}

.serp-title {
    color: #1a0dab;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    cursor: pointer;
    text-decoration: none;
}

.serp-title:hover {
    text-decoration: underline;
}

.serp-snippet {
    color: #4d5156;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Character Count Bars */
.char-meter {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.char-meter-fill {
    height: 100%;
    transition: width 0.2s ease, background 0.2s ease;
}

.meter-good { background-color: #10b981; }
.meter-warning { background-color: #f59e0b; }
.meter-bad { background-color: #ef4444; }

/* RankMath Tests List */
.rankmath-checklist {
    list-style: none;
    margin-top: 1rem;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.check-icon {
    font-size: 1rem;
    line-height: 1;
    margin-top: 0.15rem;
}

.check-icon.pass { color: #10b981; }
.check-icon.fail { color: #ef4444; }

/* ============================================================
   LIVE PREVIEW MODAL
============================================================ */
.preview-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 9999;
    padding: 2rem 1rem;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

.preview-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.preview-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin: auto;
}

.preview-modal-bar {
    background: #0f172a;
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-modal-body {
    padding: 2.5rem;
    max-height: 80vh;
    overflow-y: auto;
}
