/**
 * Auto Featured Image - Dashboard Styles
 * Based on Stitch AI Design
 */

/* Import Google Fonts - handled in settings.php for performance */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); */
/* @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap'); */

:root {
    --afi-primary: #135bec;
    --afi-primary-hover: #1d4ed8;
    --afi-bg-light: #f6f6f8;
    --afi-bg-dark: #101622;
    --afi-surface-light: #ffffff;
    --afi-surface-dark: #1a2436;
    --afi-text-main: #0d121b;
    --afi-text-muted: #64748b;
    --afi-border-light: #e2e8f0;
    --afi-border-dark: #2d3b55;
    --afi-radius: 0.5rem;
    /* 8px */
    --afi-radius-lg: 0.75rem;
    /* 12px */
    --afi-radius-xl: 1rem;
    /* 16px */
    --afi-font-family: 'Inter', sans-serif;
}

/* Reset / Scoping */
#afi-dashboard {
    font-family: var(--afi-font-family);
    background-color: var(--afi-bg-light);
    color: var(--afi-text-main);
    display: flex;
    /* Use fixed positioning to guarantee full viewport coverage */
    position: fixed;
    top: 32px;
    /* WP Admin Bar height */
    left: 160px;
    /* WP Admin Menu width (approx) */
    right: 0;
    bottom: 0;
    z-index: 999;
    /* Ensure it floats above standard WP footer */
    overflow: hidden;
}

/* 
 * WP Admin Overrides 
 * Fix for full-screen dashboard feel 
 */
.auto-featured-image_page_auto-featured-image #wpcontent {
    padding-left: 0 !important;
}

/* -------------------------------------------------------------
   Column 1: Sidebar
------------------------------------------------------------- */
.afi-sidebar {
    width: 260px;
    min-width: 260px;
    /* Critical: Prevent sidebar crushing */
    flex-shrink: 0;
    height: 100%;
    background-color: var(--afi-surface-light);
    border-right: 1px solid var(--afi-border-light);
    display: flex;
    flex-direction: column;
    z-index: 20;
    overflow-y: hidden;
    /* Hide scrollbar by default */
}

/* Show scrollbar only if absolutely needed and hovered */
.afi-sidebar:hover {
    overflow-y: auto;
}

.afi-brand {
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    /* More spacing as per design */
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.afi-brand-icon {
    width: 100%;
    height: auto;
    min-width: 0;
    background-color: transparent;
    color: #fff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: none;
}

.afi-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--afi-text-main);
    white-space: nowrap;
    /* Critical: Prevent text wrapping */
}

.afi-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Increased spacing between items */
}

.afi-nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--afi-radius);
    color: var(--afi-text-muted);
    /* Lighter gray for inactive */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    /* Slightly larger text */
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    /* Critical: Prevent text wrapping */
}

.afi-nav-item:hover {
    background-color: #f8fafc;
    color: var(--afi-text-main);
}

.afi-nav-item.active {
    background-color: #eff6ff;
    /* Match light blue from screenshot */
    color: var(--afi-primary);
}

.afi-nav-item .material-symbols-outlined {
    font-size: 1.5rem;
    min-width: 1.5rem;
    /* [FIX] Constrain dimensions to prevent layout shift if font loads late */
    width: 1.5rem;
    height: 1.5rem;
    overflow: hidden;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    /* Inactive icon color */
}

.afi-nav-item:hover .material-symbols-outlined {
    color: var(--afi-text-main);
}

.afi-nav-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    color: var(--afi-primary);
}

/* -------------------------------------------------------------
   Column 2: Main Content
------------------------------------------------------------- */
.afi-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--afi-bg-light);
    position: relative;
    min-width: 0;
}

.afi-view {
    display: none;
    /* Hidden by default */
    flex: 1;
    overflow-y: auto;
    /* This is the ONLY main scroll area now */
    padding: 2rem;
    padding-bottom: 5rem;
    /* Space for save bar */
}

.afi-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.afi-header {
    margin-bottom: 2rem;
}

.afi-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--afi-text-main);
    margin-bottom: 0.5rem;
}

.afi-subtitle {
    color: var(--afi-text-muted);
    font-size: 0.875rem;
}

/* Stats Cards (Overview) */
.afi-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.afi-card {
    background: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.afi-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--afi-text-main);
    margin-top: 0.5rem;
}

/* Settings Form Controls */
.afi-form-section {
    background: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.afi-section-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--afi-text-main);
}

.afi-input-group {
    margin-bottom: 1.5rem;
}

.afi-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--afi-text-main);
    margin-bottom: 0.5rem;
}

.afi-input,
.afi-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius);
    font-size: 0.875rem;
    color: var(--afi-text-main);
    background-color: var(--afi-surface-light);
    transition: border-color 0.15s ease;
}

.afi-input:focus,
.afi-select:focus {
    border-color: var(--afi-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 91, 236, 0.1);
}

/* Toggle Switch */
.afi-toggle {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
}

.afi-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.afi-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 1.5rem;
}

.afi-toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.afi-toggle-slider {
    background-color: var(--afi-primary);
}

input:checked+.afi-toggle-slider:before {
    transform: translateX(1.25rem);
}

/* Templates Header & Filters */
.afi-templates-header {
    margin-bottom: 2.5rem;
}

.afi-template-filter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    align-items: center;
}

.afi-filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    /* Rounded Full */
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--afi-border-light);
    background: var(--afi-surface-light);
    color: var(--afi-text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.afi-filter-btn:hover {
    border-color: #94a3b8;
}

.afi-filter-btn.active {
    background-color: #0f172a;
    /* Slate 900 for dark/bold button */
    color: #fff;
    border-color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.afi-filter-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* Template Grid (New) */
.afi-template-grid {
    display: grid;
    /* User requested 3 columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    /* Increased gap slightly for better look with fewer columns */
    padding-bottom: 2rem;
}

@media (max-width: 1024px) {
    .afi-template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .afi-template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .afi-template-grid {
        grid-template-columns: 1fr;
    }
}

/* New Card Style */
.afi-template-card-new {
    background: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-xl);
    /* Rounded XL */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Shadow SM */
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.2s ease;
    position: relative;
    /* Group hover effect handled via JS or hover pseudo */
}

.afi-template-card-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Active State styling overrides */
.afi-template-card-new.active {
    border-color: var(--afi-primary);
    box-shadow: 0 0 0 2px var(--afi-primary), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.afi-card-hero {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    /* Maintain scaling ratio */
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
    position: relative;
    height: auto;
}

/* Active Badge in Hero */
.afi-active-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--afi-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.afi-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.afi-card-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.afi-card-title {
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 700;
    color: var(--afi-text-main);
    margin: 0;
}

.afi-card-status-dot {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
}

.afi-template-card-new:hover .afi-card-status-dot {
    border-color: var(--afi-primary);
}

.afi-card-status-dot.active {
    background-color: var(--afi-primary);
    border-color: var(--afi-primary);
    box-shadow: inset 0 0 0 2px #fff;
    /* Adds a nice internal ring for "selected" feel */
}

.afi-card-desc {
    font-size: 0.875rem;
    color: var(--afi-text-muted);
    line-height: 1.4;
}

/* -------------------------------------------------------------
   Column 3: Live Preview
------------------------------------------------------------- */
.afi-preview-panel {
    width: 380px;
    min-width: 380px;
    /* Prevent shrink */
    flex-shrink: 0;
    /* The panel itself is just a container now, the card does the styling */
    padding: 1.5rem;
    z-index: 20;
    overflow-y: hidden;
    overflow-x: hidden;
    /* Optional: Centering similar to the snippet's 'flex items-start justify-center' */
    display: flex;
    justify-content: center;
}

.afi-preview-panel:hover {
    overflow-y: auto;
}

/* The Card Wrapper */
.afi-preview-card {
    width: 100%;
    background-color: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-xl);
    /* Rounded XL */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* Shadow LG */
    overflow: hidden;
    height: fit-content;
    /* Don't stretch */
}

/* Header */
.afi-preview-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--afi-border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.afi-preview-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 700;
    color: var(--afi-text-main);
}

.afi-preview-header-title .material-symbols-outlined {
    color: #94a3b8;
    /* text-slate-400 */
}

/* Body */
.afi-preview-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* space-y-6 */
}

/* Canvas Area */
.afi-preview-canvas-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#afi-preview-element {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-color: #f1f5f9;
    background-size: cover;
    background-position: center;
    border-radius: var(--afi-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Shadow MD */
}

.afi-preview-overlay-text {
    position: absolute;
    left: 40px;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 10;
    line-height: 1.3;
    /* Font size handled by JS */
}

.afi-preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.afi-meta-text {
    color: var(--afi-text-muted);
}

.afi-btn-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--afi-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
    font-size: 0.875rem;
}

.afi-btn-link:hover {
    color: var(--afi-primary-hover);
}

/* Settings Blocks */
.afi-preview-settings-block {
    background-color: #f8fafc;
    /* bg-slate-50 */
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius);
    padding: 1rem;
}

.afi-block-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    /* text-slate-400 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.afi-setting-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.afi-setting-row:last-child {
    margin-bottom: 0;
}

.afi-setting-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--afi-border-light);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.afi-setting-icon-box .material-symbols-outlined {
    font-size: 1.25rem;
}

.afi-setting-info {
    display: flex;
    flex-direction: column;
}

.afi-setting-label {
    font-size: 0.75rem;
    color: var(--afi-text-muted);
    margin-bottom: 0.125rem;
}

.afi-setting-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--afi-text-main);
    line-height: 1.25;
}

/* Template Thumbnail Row */
.afi-template-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.afi-mini-thumbnail {
    width: 5rem;
    /* w-20 */
    height: 3rem;
    /* h-12 */
    border-radius: 0.25rem;
    background-color: #e2e8f0;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.afi-btn-link-sm {
    font-size: 0.75rem;
    color: var(--afi-primary);
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-top: 0.125rem;
}


/* Button Styling (User Provided) */
.afi-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    /* Re-enable clicks on button */
}

.afi-btn-primary:hover {
    background-color: #1d4ed8;
}

.afi-btn-primary:active {
    background-color: #1e40af;
    transform: translateY(1px);
}

.save-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Save Bar Logic (Keep this) */
/* Save Bar Logic */
/* Save Bar Logic */
/* -------------------------------------------------------------
   Refactored UI (Replacing Tailwind with Semantic CSS)
------------------------------------------------------------- */

/* Containers */
.afi-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.afi-gs-header-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.afi-page-title-lrg {
    font-size: 2.25rem;
    /* 4xl */
    font-weight: 900;
    /* black */
    color: var(--afi-text-main);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.afi-page-subtitle-lrg {
    font-size: 1.125rem;
    /* lg */
    color: var(--afi-text-muted);
    font-weight: 400;
}

/* Grids */
.afi-grid-4 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    padding: 0.25rem;
}

@media (min-width: 768px) {
    .afi-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .afi-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Getting Started Cards */
.afi-gs-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background-color: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-lg);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    border-top: 4px solid var(--afi-primary);
    flex: 1;
}

.afi-gs-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.afi-gs-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.afi-gs-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background-color: rgba(19, 91, 236, 0.1);
    /* primary/10 */
    color: var(--afi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.afi-gs-icon .material-symbols-outlined {
    font-size: 1.875rem;
    /* 3xl */
}

.afi-gs-number {
    font-size: 2.25rem;
    /* 4xl */
    font-weight: 900;
    color: rgba(19, 91, 236, 0.2);
    /* primary/20 */
    user-select: none;
}

.afi-gs-title {
    font-size: 1.25rem;
    /* xl */
    font-weight: 700;
    color: var(--afi-text-main);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.afi-gs-desc {
    font-size: 0.875rem;
    /* sm */
    color: var(--afi-text-muted);
    line-height: 1.5;
    margin: 0;
}

.afi-gs-link {
    margin-top: auto;
    color: var(--afi-primary);
    font-size: 0.75rem;
    /* xs */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    cursor: pointer;
}

.afi-gs-link:hover {
    text-decoration: underline;
}

/* Quick Actions Box */
.afi-qa-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-xl);
    background-color: var(--afi-surface-light);
    padding: 1.5rem;
    align-items: flex-start;
}

@media (min-width: 480px) {
    .afi-qa-box {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.afi-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 1.25rem;
    background-color: #f1f5f9;
    color: var(--afi-text-main);
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--afi-radius);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.afi-btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Help Box */
.afi-help-box {
    margin-top: 3rem;
    padding: 1.5rem;
    border-radius: var(--afi-radius-xl);
    background-color: #f8fafc;
    /* bg-slate-100/50 approx */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .afi-help-box {
        flex-direction: row;
    }
}

/* Settings Layouts */
.afi-settings-wrapper {
    width: 100%;
    max-width: 56rem;
    /* 4xl */
    background-color: var(--afi-surface-light);
    border: 1px solid var(--afi-border-light);
    border-radius: var(--afi-radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.afi-settings-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--afi-border-light);
    background-color: var(--afi-surface-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.afi-settings-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--afi-text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.afi-settings-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .afi-settings-body {
        grid-template-columns: 1fr 1fr;
        /* 2 cols */
        column-gap: 4rem;
    }
}

.afi-settings-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* space-y-8 */
}

/* Form Elements adjustments */
.afi-pos-btn-group,
.afi-align-btn-group {
    display: flex;
    background-color: #f3f4f6;
    border-radius: var(--afi-radius);
    padding: 0.25rem;
    width: fit-content;
}

.afi-pos-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--afi-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.afi-pos-btn:hover {
    color: var(--afi-text-main);
}

.afi-pos-btn.active {
    background-color: var(--afi-surface-light);
    color: var(--afi-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Color Picker Row */
.afi-color-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.afi-swatch-box {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--afi-radius);
    border: 1px solid var(--afi-border-light);
    overflow: hidden;
    cursor: pointer;
}

.afi-swatch-preview {
    width: 100%;
    height: 100%;
}

/* Logo Grid */
.afi-logo-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 8rem;
    height: 6rem;
    background-color: #f3f4f6;
    padding: 0.5rem;
    border-radius: var(--afi-radius);
}

.afi-pos-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.afi-pos-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    background-color: #d1d5db;
    transition: background-color 0.2s;
}

.afi-pos-cell input:checked~.afi-pos-dot {
    background-color: var(--afi-primary);
}

.afi-pos-cell:hover .afi-pos-dot {
    background-color: #9ca3af;
}

/* Restored Save Bar */
.afi-save-bar {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    width: auto;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Hidden state */
.afi-save-bar.hidden {
    transform: translate(-50%, 100%);
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 1200px) {
    .afi-preview-panel {
        display: none;
    }

    .afi-save-bar {
        right: 0;
    }
}