/**
 * LuminaNote Studio - Canva & Photoshop Style Multi-Layer Studio CSS
 */

.canva-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(24px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.canva-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Studio Header */
.canva-header {
    height: 56px;
    background: #0F172A;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 10;
}

.canva-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Studio Body Layout */
.canva-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Left Icon Navigation Tabs */
.canva-nav-tabs {
    width: 72px;
    background: #0B0F19;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    z-index: 5;
}

.canva-tab-btn {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: #94A3B8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.canva-tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}

.canva-tab-btn.is-active {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Left Drawer Panel */
.canva-drawer {
    width: 320px;
    background: #111827;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 4;
}

.canva-drawer-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    font-weight: 600;
    color: #F3F4F6;
}

.canva-drawer-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Canvas Viewport (Center) */
.canva-viewport {
    flex: 1;
    background: #030712;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: auto;
    padding: 40px;
}

/* Top Canvas Object Toolbar */
.canva-object-toolbar {
    position: absolute;
    top: 16px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    max-width: 95%;
    overflow-x: auto;
}

/* Canvas Paper Container */
.canva-paper-wrapper {
    position: relative;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: #FFFFFF;
    transition: transform 0.1s ease;
}

/* Bleed and Margin Guides */
.canva-guide-bleed {
    position: absolute;
    inset: -12px;
    border: 1px dashed rgba(239, 68, 68, 0.6);
    pointer-events: none;
    border-radius: 6px;
}

.canva-guide-bleed::after {
    content: 'BLEED (3mm)';
    position: absolute;
    top: -14px;
    left: 4px;
    font-size: 8px;
    font-weight: 700;
    color: #EF4444;
    letter-spacing: 0.5px;
}

.canva-guide-safe {
    position: absolute;
    inset: 20px;
    border: 1px dashed rgba(59, 130, 246, 0.4);
    pointer-events: none;
}

.canva-guide-safe::after {
    content: 'SAFE AREA';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 8px;
    font-weight: 600;
    color: #60A5FA;
}

/* Textures Presets Grid */
.texture-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.texture-card {
    height: 70px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.texture-card:hover {
    border-color: #3B82F6;
    transform: scale(1.03);
}

.texture-card.is-active {
    border: 2px solid #3B82F6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* Foil Presets Buttons */
.foil-btn {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.foil-gold {
    background: linear-gradient(135deg, #FDE047, #CA8A04, #EAB308);
    color: #422006;
}

.foil-rosegold {
    background: linear-gradient(135deg, #FECDD3, #F43F5E, #FB7185);
    color: #4C0519;
}

.foil-silver {
    background: linear-gradient(135deg, #FFFFFF, #94A3B8, #CBD5E1);
    color: #0F172A;
}

/* Right Layers Panel */
.canva-layers-panel {
    width: 290px;
    background: #0F172A;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 4;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 12px;
    color: #E2E8F0;
    transition: all 0.15s ease;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.layer-item.is-selected {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3B82F6;
    color: #93C5FD;
}

.layer-action-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #94A3B8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.1s ease;
}

.layer-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

/* Floating Zoom Bar */
.canva-zoom-bar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.zoom-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.1);
}

.zoom-label {
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
    color: #F8FAFC;
    min-width: 36px;
    text-align: center;
}

/* ==========================================================================
   GOOGLE & SYSTEM FONT PICKER MODAL (100+ FONTS WITH LIVE TYPOGRAPHY PREVIEWS)
   ========================================================================== */
.fp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(16px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fp-modal-overlay.is-open {
    display: flex;
    opacity: 1;
}

.fp-modal-card {
    background: #0F172A;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    width: 92vw;
    max-width: 880px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fpPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fpPop {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1.0) translateY(0); opacity: 1; }
}

.fp-modal-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fp-search-bar-row {
    display: flex;
    gap: 12px;
    padding: 14px 24px 10px;
}

.fp-search-input {
    flex: 1;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 9px 14px;
    color: #FFFFFF;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.fp-search-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.fp-sample-input {
    flex: 1.2;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 9px 14px;
    color: #93C5FD;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.fp-sample-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.fp-cats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fp-cat-chip {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: #94A3B8;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fp-cat-chip:hover {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.2);
    background: #334155;
}

.fp-cat-chip.is-active {
    background: #2563EB;
    border-color: #60A5FA;
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.fp-cards-grid {
    flex: 1;
    padding: 16px 24px 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    align-content: start;
}

.fp-font-card {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fp-font-card:hover {
    border-color: #3B82F6;
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 14px rgba(59, 130, 246, 0.2);
}

.fp-font-card.is-active {
    border-color: #3B82F6;
    background: rgba(37, 99, 235, 0.15);
    box-shadow: 0 0 0 2px #3B82F6;
}

.fp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fp-font-title {
    font-size: 13px;
    font-weight: 700;
    color: #F8FAFC;
}

.fp-cat-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 6px;
}

.fp-card-sample-box {
    font-size: 17px;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 28px;
    line-height: 28px;
}

.fp-weights-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.fp-weight-chip {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.12s ease;
}

.fp-weight-chip:hover, .fp-weight-chip.is-active {
    border-color: #3B82F6;
    color: #FFFFFF;
    background: #2563EB;
}

/* Inline Double-Click Text Overlay on Canvas */
.canva-inline-text-box {
    position: absolute;
    z-index: 50;
    display: none;
    background: rgba(15, 23, 42, 0.95);
    border: 2px dashed #3B82F6;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(59, 130, 246, 0.3);
}

.canva-inline-text-textarea {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    resize: none;
    width: 100%;
    height: 100%;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-align: inherit;
    line-height: 1.2;
}
