/* CSS Variables & Global Reset */
:root {
    --primary-color: #3b82f6;
    --cv-width: 210mm;
    --cv-height: 297mm;

    /* App UI */
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --border-color: #334155;
    --text-white: #f8fafc;
    --text-muted: #64748b;
    --font-ui: 'Inter', sans-serif;
    --border: #e2e8f0;
}

.save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.save-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.save-status.success {
    background: #dcfce7;
    color: #166534;
}

.save-status.error {
    background: #fee2e2;
    color: #991b1b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-dark);
    color: var(--text-white);
    height: 100vh;
    overflow: hidden;
}

/* === APP UI LAYOUT === */
.app-container {
    display: flex;
    height: 100vh;
}

/* Shared Sidebar Styling (Index/Editor/Builder) */
.sidebar,
.toolbox {
    width: 320px;
    /* Increased from 280px for better visibility */
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    height: 100vh;
    /* Full height */
    position: relative;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Keep header fixed */
}

.sidebar-content,
.tool-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    height: 100%;
    /* Ensure it takes available space */
}

@media print {
    @page {
        margin: 0;
        size: auto;
    }

    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: visible !important;
        background: white;
    }

    /* Hide UI - Comprehensive List */
    .toolbox,
    .stats-panel,
    .properties-panel,
    .workspace-toolbar,
    .resize-handle,
    .block-actions,
    .actions,
    .drop-zone,
    .empty-drop-zone,
    .add-page-btn,
    .sidebar,
    .preview-toolbar,
    .preview-top-bar,
    .hero-section {
        display: none !important;
    }

    /* Reset Containers */
    /* Ensure the app flex container doesn't lock height */
    .app-container {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .builder-container,
    .workspace,
    .canvas-scroller,
    .cv-paper-container {
        display: block !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        background: white !important;
    }

    /* Page Styles - Reset transform/zoom */
    .cv-page,
    .cv-paper {
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: always;
        /* Ensure page break works */
        break-after: page;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        overflow: visible !important;
        /* Allow transforms for fit-to-page logic */
        /* transform: none !important; */
        /* zoom: 1 !important; */
    }
}

.editor-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

input,
textarea {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.skill-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.skill-item button {
    color: #ef4444;
}

/* Lists */
.list-item-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: move;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* Modern Button System */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Preview */
.preview-area {
    flex: 1;
    background: #0f172a;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Keep UI contained */
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
}

.cv-paper-container {
    flex: 1;
    overflow: auto;
    /* Enable native scrolling */
    display: flex;
    /* Flex to center content */
    justify-content: center;
    align-items: flex-start;
    /* Align top so it scrolls correctly */
    padding: 3rem;
}

/* CV Paper (Canvas) */
.cv-paper {
    background: white;
    width: 210mm;
    min-height: 297mm;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
    /* Don't shrink in flex */

    /* Critical that we don't overflow HIDDEN here */
    overflow: hidden;

    /* Removed transform properties in favor of JS zoom */
    margin-bottom: 50px;
}

/* Preview Top Bar */
.preview-top-bar {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 5;
}

.top-bar-actions {
    display: flex;
    gap: 1rem;
}

.preview-toolbar {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 50px;
    display: flex;
    gap: 1rem;
    z-index: 10;
}

.zoom-controls button {
    background: none;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

/* =========================================
   LANDING PAGE CSS
   ========================================= */
body.landing-page {
    overflow-y: auto;
    display: block;
    height: auto;
}

.hero-section {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid var(--border-color);
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-content .highlight {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.gallery-container {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.template-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.btn-delete-saved {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.template-card:hover .btn-delete-saved {
    opacity: 1;
}

.btn-delete-saved:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.card-preview {
    height: 400px;
    background: #f8fafc;
    /* Light gray background to show card boundaries */
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
    display: block;
    /* Remove flex interactions */
}

.card-preview-inner {
    width: 210mm;
    height: 297mm;
    position: absolute;
    left: 50%;
    top: 20px;
    /* Center the layout box first (move left by half width), then scale */
    /* 210mm / 2 = 105mm */
    margin-left: -105mm;
    transform: scale(0.31);
    transform-origin: top center;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
}

.card-info {
    padding: 1rem;
    background: #1e293b;
    z-index: 2;
    position: relative;
}

.card-info h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.card-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* =========================================
   ARCHETYPE STYLES
   ========================================= */

/* Common Defaults */
[class^="archetype-"] {
    width: 100%;
    min-height: var(--cv-height);
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

[class^="archetype-"] h1,
[class^="archetype-"] h2,
[class^="archetype-"] h3 {
    font-family: var(--font-head);
}

[class^="archetype-"] ul {
    list-style: none;
}

/* PHOTO STYLES DEFAULTS */
.profile-photo {
    overflow: hidden;
    background: #eee;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- ARCHETYPE 1: SIDEBAR LEFT --- */
.archetype-sidebar-left {
    display: flex;
}

.archetype-sidebar-left .cv-sidebar {
    width: 32%;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.archetype-sidebar-left .cv-main {
    flex: 1;
    padding: 3rem;
}

.archetype-sidebar-left .profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    border: 4px solid rgba(255, 255, 255, 0.2);
}

.archetype-sidebar-left .name {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.archetype-sidebar-left .title {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 500;
}

.archetype-sidebar-left .contact-group .item {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
}

.archetype-sidebar-left .skills-group h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    color: var(--primary);
}

.archetype-sidebar-left .skills-group li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.archetype-sidebar-left .section-block {
    margin-bottom: 2.5rem;
}

.archetype-sidebar-left .section-block h3 {
    color: var(--secondary);
    font-size: 1.2rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.archetype-sidebar-left .entry {
    margin-bottom: 1.5rem;
}

.archetype-sidebar-left .entry-head {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text);
    font-size: 1.1rem;
}

.archetype-sidebar-left .entry-sub {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}


/* --- ARCHETYPE 2: CLASSIC CENTERED --- */
.archetype-classic {
    padding: 4rem 5rem;
    text-align: left;
}

.archetype-classic .classic-header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--text-muted);
    padding-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.archetype-classic .profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    border: 1px solid var(--text-muted);
}

.archetype-classic .name {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.archetype-classic .title {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.archetype-classic .contact-line {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.archetype-classic .summary-section {
    text-align: center;
    max-width: 80%;
    margin: 0 auto 3rem auto;
    font-style: italic;
    line-height: 1.6;
}

.archetype-classic .section-block {
    margin-bottom: 3rem;
}

.archetype-classic .section-block h3 {
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.archetype-classic .entry {
    margin-bottom: 2rem;
}

.archetype-classic .entry-head {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

.archetype-classic .entry-title {
    font-weight: 700;
    color: var(--text);
}

.archetype-classic .entry-sub {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.5rem;
}

.archetype-classic .skills-line {
    text-align: center;
    color: var(--text);
    font-weight: 500;
    letter-spacing: 1px;
}


/* --- ARCHETYPE 3: SIDEBAR RIGHT --- */
.archetype-sidebar-right {
    display: flex;
}

.archetype-sidebar-right .cv-main {
    flex: 1;
    padding: 4rem;
    order: 1;
}

.archetype-sidebar-right .cv-sidebar {
    width: 30%;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 4rem 2rem;
    order: 2;
    border-left: 10px solid var(--primary);
    display: flex;
    flex-direction: column;
}

.archetype-sidebar-right .profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    margin-bottom: 2rem;
    align-self: flex-start;
}

.archetype-sidebar-right .main-header {
    margin-bottom: 4rem;
}

.archetype-sidebar-right .name {
    font-size: 4rem;
    line-height: 0.9;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: -2px;
}

.archetype-sidebar-right .title {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--text);
}

.archetype-sidebar-right .summary {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    border-left: 4px solid var(--text-muted);
    padding-left: 1.5rem;
}

.archetype-sidebar-right .section-block {
    margin-bottom: 4rem;
}

.archetype-sidebar-right h3 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.archetype-sidebar-right .cv-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--sidebar-text);
    opacity: 0.8;
}

.archetype-sidebar-right .entry {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2.5rem;
}

.archetype-sidebar-right .entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    list-style: none;
    width: 8px;
    height: 8px;
    background: var(--primary);
}

.archetype-sidebar-right .entry-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: block;
}

.archetype-sidebar-right .entry-sub {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-muted);
}


/* --- ARCHETYPE 4: HEADLINE --- */
.archetype-headline {
    display: flex;
    flex-direction: column;
}

.archetype-headline .top-block {
    background: var(--primary);
    color: var(--sidebar-text);
    padding: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    position: relative;
}

.archetype-headline .profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--bg);
    position: absolute;
    bottom: -70px;
    left: 3rem;
    z-index: 5;
}

.archetype-headline .name {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    margin-left: 160px;
    /* shift for photo */
}

.archetype-headline .title {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
    margin-left: 160px;
}

.archetype-headline .top-contact {
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
}

.archetype-headline .split-body {
    flex: 1;
    display: flex;
    margin-top: 4rem;
    /* space for photo */
}

.archetype-headline .body-main {
    flex: 1;
    padding: 3rem;
    border-right: 1px solid #eee;
}

.archetype-headline .body-side {
    width: 30%;
    padding: 3rem;
    background: #fafafa;
}

.archetype-headline .section-block {
    margin-bottom: 3rem;
}

.archetype-headline h3 {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.archetype-headline .entry {
    margin-bottom: 2rem;
}

.archetype-headline .entry-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
}

.archetype-headline .entry-sub {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.archetype-headline .skill-tag {
    display: inline-block;
    background: var(--primary);
    color: var(--sidebar-text);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 0 5px 5px 0;
    font-weight: 600;
}


@media print {
    @page {
        margin: 0;
        size: auto;
    }

    body {
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide UI */
    .toolbox,
    .properties-panel,
    .workspace-toolbar,
    .resize-handle,
    .block-actions,
    .actions,
    .drop-zone,
    .empty-drop-zone,
    .add-page-btn {
        display: none !important;
    }

    /* Reset Containers */
    .builder-container,
    .workspace,
    .canvas-scroller {
        display: block !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
    }

    /* Page Styles */
    .cv-page {
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: always;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        overflow: hidden !important;
        /* Clip content to page */
    }

    .cv-page:last-child {
        page-break-after: auto;
    }
}

/* Ensure Preview Area is visible and reset */
/* Ensure Preview Area is visible and scrollable */
.preview-area {
    display: block;
    background: white;
    padding: 0;
    margin: 0;
    height: 100vh;
    /* Full viewport height */
    overflow-y: auto;
    /* Enable native vertical scrolling */
    position: relative;
}

.cv-paper-container {
    display: block;
    padding: 0;
    margin: 0;
    height: auto;
    overflow: visible;
}

.cv-paper {
    box-shadow: none;
    margin: 0;
    width: 100%;
    min-height: auto;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    transform: none !important;
    zoom: 1 !important;
    /* Force reset zoom */
    margin-bottom: 0 !important;
}

/* Specific fix for Editor Print context inside media query */
@media print {

    .sidebar,
    .template-gallery,
    #zoom-controls,
    .sidebar-tabs,
    .editor-header {
        display: none !important;
    }

    body {
        overflow: visible !important;
    }

    /* Reset Zoom for Print */
    #cv-preview,
    #cv-canvas,
    .cv-canvas {
        zoom: 1 !important;
        transform: none !important;
        width: 210mm !important;
        height: 297mm !important;
        /* Force full height */
        overflow: visible !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    .cv-paper {
        margin: 0 !important;
        box-shadow: none !important;
    }
}

@page {
    margin: 0;
    size: auto;
}

/* =========================================
   LANDING PAGE STYLES
   ========================================= */

html {
    scroll-behavior: smooth;
}

.landing-page {
    background: var(--bg-dark);
    color: white;
    height: 100vh;
    overflow-y: auto;
    /* Allow full page scrolling */
}

.hero-section {
    padding: 100px 20px 80px 20px;
    text-align: center;
    background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 70%);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 25px;
    line-height: 1.1;
    font-family: var(--font-ui);
    letter-spacing: -1px;
}

.hero-section .highlight {
    background: linear-gradient(120deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-intro {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 50px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    height: 40px;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.gallery-container {
    padding: 0 40px 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

/* === ENHANCED UI ELEMENTS === */

/* Floating Formatting Toolbar Animation */
.formatting-toolbar,
.image-floating-toolbar {
    animation: toolbar-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toolbar-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Base styling for all properties inputs for consistent premium feel */
.properties-panel select,
.properties-panel input,
.properties-panel textarea {
    transition: all 0.2s ease;
}

.properties-panel select:hover,
.properties-panel input:hover,
.properties-panel textarea:hover {
    border-color: #475569 !important;
    background-color: #1e293b !important;
}

.properties-panel select:focus,
.properties-panel input:focus,
.properties-panel textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background-color: #0f172a !important;
}
/* High-Visibility Selection State */
.cv-layer.selected {
    outline: 2px solid #3b82f6 !important; /* Primary Blue */
    background-color: rgba(59, 130, 246, 0.05); /* Subtle tint */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
    animation: selectionPulse 0.3s ease-out;
}

@keyframes selectionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
