/**
 * VIXMA EDITOR V2 - IMMERSIVE LAYOUT
 * Full-width preview + sliding panel
 * 
 * @version 4.0
 * @brand Vixma - własne DNA
 * @date 2026
 */

/* ==========================================================================
   VIXMA BRAND VARIABLES
   ========================================================================== */
.gamma-fullscreen-editor {
    --vixma-primary: #6366F1;
    --vixma-primary-dark: #4F46E5;
    --vixma-primary-light: #818CF8;
    --vixma-secondary: #A855F7;
    --vixma-accent: #FFC107;
    --vixma-accent-dark: #FF9800;
    --vixma-gradient: linear-gradient(135deg, #6366F1, #A855F7);
    --vixma-gradient-accent: linear-gradient(135deg, #FFC107, #FF9800);
    
    /* VIXMA Light Theme */
    --vixma-bg: #f8f9fc;
    --vixma-panel-bg: #FFFFFF;
    --vixma-bg-glass: rgba(99, 102, 241, 0.05);
    --vixma-bg-glass-hover: rgba(99, 102, 241, 0.1);
    --vixma-border-glass: #E2E8F0;
    --vixma-text: #0F172A;
    --vixma-text-secondary: #475569;
    --vixma-text-muted: #94A3B8;
    
    /* Panel width */
    --panel-width: 400px;
    --panel-collapsed-width: 0px;
    --toolbar-height: 56px;
}

/* ==========================================================================
   FULLSCREEN EDITOR - BASE
   ========================================================================== */
.gamma-fullscreen-editor {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: var(--vixma-bg) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden;
}

/* ==========================================================================
   FLOATING TOOLBAR (TOP CENTER)
   ========================================================================== */
.gamma-editor-header {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    
    background: rgba(248, 249, 252, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.gamma-editor-header .logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid var(--vixma-border-glass);
}

.gamma-editor-header .logo-section img {
    height: 28px;
    width: auto;
}

.gamma-editor-header .logo-section .title,
.gamma-editor-header .logo-section .subtitle {
    display: none; /* Ukryte w kompaktowym toolbarze */
}

.gamma-editor-header .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toolbar buttons */
.gamma-editor-header .btn-back,
.gamma-editor-header .btn-publish,
.gamma-editor-header .btn-export {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gamma-editor-header .btn-back {
    background: var(--vixma-bg-glass);
    color: var(--vixma-text-secondary);
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
}

.gamma-editor-header .btn-back:hover {
    background: var(--vixma-bg-glass-hover);
    color: #1e293b; font-weight: 500;
}

.gamma-editor-header .btn-publish {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.gamma-editor-header .btn-publish:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.gamma-editor-header .btn-export {
    background: var(--vixma-gradient-accent);
    color: #000;
    font-weight: 600;
}

.gamma-editor-header .btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* ==========================================================================
   MAIN AREA - FULL WIDTH PREVIEW
   ========================================================================== */
.gamma-editor-main {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   PREVIEW SECTION - 100% WIDTH
   ========================================================================== */
.gamma-preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--vixma-bg);
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When panel is open */
.gamma-fullscreen-editor.panel-open .gamma-preview-section {
    margin-right: var(--panel-width);
}

/* Preview Toolbar - floating bottom */
.gamma-preview-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    
    background: rgba(248, 249, 252, 0.98);
    backdrop-filter: blur(20px);
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.gamma-preview-toolbar .view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--vixma-text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gamma-preview-toolbar .view-btn:hover {
    background: var(--vixma-bg-glass-hover);
    color: #1e293b; font-weight: 500;
}

.gamma-preview-toolbar .view-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--vixma-primary-light);
}

.gamma-preview-toolbar .view-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gamma-preview-toolbar .divider {
    width: 1px;
    height: 24px;
    background: var(--vixma-border-glass);
    margin: 0 4px;
}

/* Preview Container - full viewport */
.gamma-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 80px 24px; /* Space for toolbars */
    overflow: auto;
}

.gamma-preview-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive preview modes */
.gamma-preview-frame.tablet-view {
    max-width: 768px;
    border-radius: 20px;
    box-shadow: 
        0 0 0 12px #1a1a2e,
        0 25px 50px rgba(0, 0, 0, 0.5);
}

.gamma-preview-frame.mobile-view {
    max-width: 375px;
    border-radius: 40px;
    box-shadow: 
        0 0 0 14px #1a1a2e,
        0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Browser chrome */
.gamma-preview-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(180deg, #2a2a35 0%, #1f1f28 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 10;
}

.gamma-preview-frame::after {
    content: '● ● ●';
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 10px;
    letter-spacing: 4px;
    color: #4a4a55;
    z-index: 11;
}

.gamma-preview-iframe {
    width: 100%;
    height: calc(100% - 32px);
    margin-top: 32px;
    border: none;
    background: #fff;
}

/* Hide default hint, show custom */
.gamma-preview-hint {
    display: none;
}

/* ==========================================================================
   EDITOR PANEL - SLIDING FROM RIGHT
   ========================================================================== */
.gamma-editor-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--panel-width);
    height: 100vh;
    z-index: 200;
    
    display: flex;
    flex-direction: column;
    
    background: var(--vixma-panel-bg);
    border-left: 1px solid var(--vixma-border-glass);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel open state */
.gamma-fullscreen-editor.panel-open .gamma-editor-panel {
    transform: translateX(0);
}

/* Panel Header */
.gamma-panel-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--vixma-border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gamma-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b; font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gamma-panel-header p {
    display: none; /* Ukryty subtitle w kompaktowym widoku */
}

/* Close panel button */
.gamma-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    color: var(--vixma-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.gamma-panel-close:hover {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

/* Panel Content */
.gamma-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Scrollbar styling */
.gamma-panel-content::-webkit-scrollbar {
    width: 6px;
}

.gamma-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.gamma-panel-content::-webkit-scrollbar-thumb {
    background: var(--vixma-border-glass);
    border-radius: 3px;
}

.gamma-panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--vixma-text-muted);
}

/* ==========================================================================
   PANEL TOGGLE BUTTON (ALWAYS VISIBLE)
   ========================================================================== */
.gamma-panel-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 150;
    
    width: 44px;
    height: 88px;
    
    background: var(--vixma-panel-bg);
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-right: none;
    border-radius: 12px 0 0 12px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    
    color: var(--vixma-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.gamma-panel-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #1e293b; font-weight: 500;
    width: 52px;
}

.gamma-panel-toggle .toggle-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.gamma-panel-toggle .toggle-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* When panel is open - hide toggle or change icon */
.gamma-fullscreen-editor.panel-open .gamma-panel-toggle {
    right: var(--panel-width);
}

.gamma-fullscreen-editor.panel-open .gamma-panel-toggle .toggle-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   EMPTY STATE (IN PANEL)
   ========================================================================== */
.gamma-empty-state {
    text-align: center;
    padding: 24px 16px;
}

.gamma-empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.gamma-empty-state h4 {
    font-size: 16px;
    color: #1e293b; font-weight: 500;
    margin: 0 0 8px 0;
}

.gamma-empty-state p {
    font-size: 13px;
    color: var(--vixma-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Quick Actions */
.gamma-quick-actions {
    margin-top: 20px;
    text-align: left;
}

.gamma-quick-actions h5 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vixma-text-muted);
    margin: 0 0 10px 0;
}

.gamma-quick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 6px;
    
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    
    color: #1e293b; font-weight: 500;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gamma-quick-btn:hover {
    background: #EEF2FF;
    border-color: var(--vixma-primary);
    transform: translateX(4px);
}

.gamma-quick-btn .icon,
.gamma-quick-btn span[data-icon] {
    font-size: 16px;
    opacity: 1; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); padding: 6px; border-radius: 6px; color: white;
}

/* ==========================================================================
   ELEMENT EDITOR (IN PANEL)
   ========================================================================== */
.gamma-element-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gamma-editor-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--vixma-text-secondary);
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 12px;
}

.gamma-editor-back:hover {
    color: #1e293b; font-weight: 500;
}

.gamma-editor-title {
    font-size: 16px;
    color: #1e293b; font-weight: 500;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Fields */
.gamma-field {
    margin-bottom: 16px;
}

.gamma-field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--vixma-text-secondary);
    margin-bottom: 6px;
}

.gamma-field input[type="text"],
.gamma-field input[type="url"],
.gamma-field textarea,
.gamma-field select {
    width: 100%;
    padding: 10px 12px;
    background: #FFFFFF;
    border: 1.5px solid #c7d2fe; box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    color: #1e293b; font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.gamma-field input:focus,
.gamma-field textarea:focus,
.gamma-field select:focus {
    outline: none;
    border-color: var(--vixma-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.gamma-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Editor Actions */
.gamma-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--vixma-border-glass);
}

.gamma-btn-regenerate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--vixma-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gamma-btn-regenerate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.gamma-btn-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--vixma-gradient-accent);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gamma-btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

/* ==========================================================================
   CLICK HINT OVERLAY
   ========================================================================== */
.vixma-click-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    
    padding: 12px 20px;
    background: rgba(99, 102, 241, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    
    color: white;
    font-size: 14px;
    font-weight: 500;
    
    animation: hintPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.8; transform: translateX(-50%) translateY(-5px); }
}

/* Hide after first interaction */
.gamma-fullscreen-editor.interacted .vixma-click-hint {
    display: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .gamma-fullscreen-editor {
        --panel-width: 100%;
    }
    
    .gamma-editor-panel {
        width: 100%;
        max-width: 400px;
    }
    
    .gamma-panel-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .gamma-editor-header {
        top: 8px;
        padding: 6px 10px;
        gap: 8px;
    }
    
    .gamma-editor-header .logo-section {
        display: none;
    }
    
    .gamma-editor-header .btn-back,
    .gamma-editor-header .btn-publish,
    .gamma-editor-header .btn-export {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .gamma-preview-toolbar {
        bottom: 16px;
        padding: 6px 8px;
    }
    
    .gamma-preview-toolbar .view-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.gamma-fullscreen-editor {
    animation: editorFadeIn 0.3s ease;
}

@keyframes editorFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Panel slide animation is handled by transform transition */

/* Loading states */
.gamma-loading {
    position: relative;
    pointer-events: none;
}

.gamma-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.1);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}


/* ==========================================================================
   HERO EFFECTS - PARTICLES & GLOW
   ========================================================================== */

/* Particles Container */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.hero-particles .particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: particleFloat 15s infinite ease-in-out;
}

.hero-particles .particle:nth-child(1) {
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: 10%; left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.hero-particles .particle:nth-child(2) {
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    top: 60%; right: 15%;
    animation-delay: -5s;
    animation-duration: 25s;
}

.hero-particles .particle:nth-child(3) {
    width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5) 0%, transparent 70%);
    bottom: 20%; left: 30%;
    animation-delay: -10s;
    animation-duration: 18s;
}

.hero-particles .particle:nth-child(4) {
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    top: 30%; right: 25%;
    animation-delay: -7s;
    animation-duration: 22s;
}

.hero-particles .particle:nth-child(5) {
    width: 50px; height: 50px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.4) 0%, transparent 70%);
    bottom: 40%; left: 60%;
    animation-delay: -3s;
    animation-duration: 16s;
}

.hero-particles .particle:nth-child(6) {
    width: 90px; height: 90px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
    top: 70%; left: 5%;
    animation-delay: -12s;
    animation-duration: 24s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -40px) scale(1.1);
        opacity: 0.4;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 1; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); padding: 6px; border-radius: 6px; color: white;
    }
    75% {
        transform: translate(40px, 30px) scale(1.05);
        opacity: 0.5;
    }
}

/* Glow Effects */
.hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    animation: glowPulse 8s infinite ease-in-out;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 1; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); padding: 6px; border-radius: 6px; color: white;
        transform: scale(1.05);
    }
}

/* Hero content should be above effects */
.hero-content, .hero .container, .hero > div:not(.hero-particles):not(.hero-glow) {
    position: relative;
    z-index: 2;
}

/* Theme-specific particle colors */
.theme-sahara .hero-particles .particle {
    background: radial-gradient(circle, rgba(212, 165, 116, 0.4) 0%, transparent 70%) !important;
}

.theme-sunset .hero-particles .particle:nth-child(odd) {
    background: radial-gradient(circle, rgba(241, 39, 17, 0.3) 0%, transparent 70%) !important;
}
.theme-sunset .hero-particles .particle:nth-child(even) {
    background: radial-gradient(circle, rgba(245, 175, 25, 0.3) 0%, transparent 70%) !important;
}

.theme-ocean .hero-particles .particle {
    background: radial-gradient(circle, rgba(33, 147, 176, 0.4) 0%, transparent 70%) !important;
}

.theme-forest .hero-particles .particle {
    background: radial-gradient(circle, rgba(113, 178, 128, 0.4) 0%, transparent 70%) !important;
}

/* Button glow effect */
.btn-glow, .cta-glow {
    position: relative;
    overflow: visible;
}

.btn-glow::before, .cta-glow::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: inherit;
    border-radius: inherit;
    filter: blur(15px);
    opacity: 0.5;
    z-index: -1;
    animation: buttonGlow 2s infinite ease-in-out;
}

@keyframes buttonGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.05); }
}


/* ==========================================================================
   IMAGE SHAPES - GAMMA-STYLE CUTOUTS & FRAMES
   ========================================================================== */

/* Hero image with notched corner */
.img-notched,
.hero-image-notched {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        15% 100%,
        0 85%
    );
}

.img-notched-tr {
    clip-path: polygon(
        0 0,
        85% 0,
        100% 15%,
        100% 100%,
        0 100%
    );
}

.img-notched-bl {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        15% 100%,
        0 85%
    );
}

.img-notched-br {
    clip-path: polygon(
        0 0,
        100% 0,
        100% 85%,
        85% 100%,
        0 100%
    );
}

/* Double notch - opposite corners */
.img-notched-double {
    clip-path: polygon(
        15% 0,
        100% 0,
        100% 85%,
        85% 100%,
        0 100%,
        0 15%
    );
}

/* Circle images - perfect for team/avatars */
.img-circle {
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Soft rounded - modern look */
.img-rounded-soft {
    border-radius: 24px !important;
}

.img-rounded-medium {
    border-radius: 16px !important;
}

.img-rounded-large {
    border-radius: 32px !important;
}

/* Blob shapes - organic */
.img-blob-1 {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40% !important;
}

.img-blob-2 {
    border-radius: 40% 60% 70% 30% / 40% 70% 30% 60% !important;
}

.img-blob-3 {
    border-radius: 50% 50% 40% 60% / 35% 65% 35% 65% !important;
}

/* Pill shape */
.img-pill {
    border-radius: 9999px !important;
}

/* Diamond shape */
.img-diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* Hexagon */
.img-hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* Arch top */
.img-arch {
    border-radius: 50% 50% 0 0 / 30% 30% 0 0 !important;
}

/* Ticket shape - notched sides */
.img-ticket {
    clip-path: polygon(
        0 10%,
        5% 10%,
        5% 0,
        95% 0,
        95% 10%,
        100% 10%,
        100% 90%,
        95% 90%,
        95% 100%,
        5% 100%,
        5% 90%,
        0 90%
    );
}

/* Frame with shadow - premium look */
.img-framed {
    border-radius: 12px !important;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Polaroid style */
.img-polaroid {
    background: white;
    padding: 8px 8px 32px 8px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Gradient border */
.img-gradient-border {
    border: 4px solid transparent !important;
    border-radius: 16px !important;
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #6366f1, #a855f7, #ec4899) border-box !important;
}

/* Floating effect */
.img-floating {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-4px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-floating:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 35px 60px -15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

/* Tilt effect */
.img-tilt-left {
    transform: rotate(-3deg);
}

.img-tilt-right {
    transform: rotate(3deg);
}

/* Overlay gradient */
.img-overlay-gradient {
    position: relative;
}

.img-overlay-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
    pointer-events: none;
}

/* Vignette effect */
.img-vignette {
    position: relative;
}

.img-vignette::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.3);
    pointer-events: none;
    border-radius: inherit;
}


/* ==========================================================================
   SECTION TOOLBAR - GAMMA-STYLE CONTEXT MENU
   ========================================================================== */

.section-toolbar {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
}

.section-toolbar.visible {
    opacity: 1;
    visibility: visible;
}

/* Divider */
.section-toolbar .toolbar-divider {
    width: 1px;
    height: 24px;
    background: #E2E8F0;
}

/* Dropdown button */
.section-toolbar .toolbar-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 13px;
    transition: all 0.15s ease;
}

.section-toolbar .toolbar-dropdown:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}

.section-toolbar .toolbar-dropdown svg {
    width: 16px;
    height: 16px;
}

/* Slider container */
.section-toolbar .toolbar-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
}

.section-toolbar .toolbar-slider input[type="range"] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: #E2E8F0;
    border-radius: 2px;
    cursor: pointer;
}

.section-toolbar .toolbar-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #6366F1;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.section-toolbar .toolbar-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Icon buttons */
.section-toolbar .toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #64748B;
    transition: all 0.15s ease;
}

.section-toolbar .toolbar-btn:hover {
    background: #F1F5F9;
    color: #334155;
}

.section-toolbar .toolbar-btn.active {
    background: #EEF2FF;
    color: #6366F1;
}

.section-toolbar .toolbar-btn svg {
    width: 18px;
    height: 18px;
}

/* Shape selector dropdown */
.section-toolbar .shape-dropdown {
    position: relative;
}

.section-toolbar .shape-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    gap: 4px;
    min-width: 160px;
}

.section-toolbar .shape-menu.open {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.section-toolbar .shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.section-toolbar .shape-option:hover {
    background: #F1F5F9;
}

.section-toolbar .shape-option.active {
    background: #EEF2FF;
}

.section-toolbar .shape-preview {
    width: 32px;
    height: 32px;
    background: #CBD5E1;
}

.section-toolbar .shape-preview.circle {
    border-radius: 50%;
}

.section-toolbar .shape-preview.rounded {
    border-radius: 8px;
}

.section-toolbar .shape-preview.square {
    border-radius: 0;
}

.section-toolbar .shape-preview.notched {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%, 0 85%);
}

.section-toolbar .shape-preview.blob {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

.section-toolbar .shape-label {
    font-size: 10px;
    color: #64748B;
}

/* Delete button - red on hover */
.section-toolbar .toolbar-btn.delete:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* AI button - gradient */
.section-toolbar .toolbar-btn.ai-btn {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}
.section-toolbar .toolbar-btn.ai-btn:hover {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    transform: scale(1.05);
}

/* Theme button - sun gradient */
.section-toolbar .toolbar-btn.theme-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    color: white;
}
.section-toolbar .toolbar-btn.theme-btn:hover {
    background: linear-gradient(135deg, #D97706 0%, #EA580C 100%);
    transform: scale(1.05);
}

/* Link button */
.section-toolbar .toolbar-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    color: #6366F1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.section-toolbar .toolbar-link:hover {
    background: #EEF2FF;
}

.section-toolbar .toolbar-link svg {
    width: 14px;
    height: 14px;
}

/* Alignment buttons group */
.section-toolbar .align-group {
    display: flex;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-radius: 8px;
    padding: 2px;
}

.section-toolbar .align-group .toolbar-btn {
    width: 28px;
    height: 28px;
}


/* ==========================================================================
   LAYOUT PICKER - INTELIGENTNE UKŁADY (GAMMA-STYLE)
   ========================================================================== */

.layout-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.layout-picker-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.layout-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 520px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    overflow: hidden;
}

.layout-picker.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.layout-picker-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E2E8F0;
}

.layout-picker-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #0F172A;
}

.layout-picker-header h3 svg {
    width: 20px;
    height: 20px;
    color: #6366F1;
}

.layout-picker-header p {
    margin: 0;
    font-size: 14px;
    color: #64748B;
}

.layout-picker-content {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.layout-section {
    margin-bottom: 24px;
}

.layout-section:last-child {
    margin-bottom: 0;
}

.layout-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.layout-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.layout-option:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
}

.layout-option.active {
    background: #EEF2FF;
    border-color: #6366F1;
}

.layout-option-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366F1;
}

.layout-option-icon svg {
    width: 32px;
    height: 32px;
}

.layout-option-label {
    font-size: 12px;
    color: #334155;
    text-align: center;
    line-height: 1.3;
}

/* Close button */
.layout-picker-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #64748B;
    transition: all 0.15s ease;
}

.layout-picker-close:hover {
    background: #F1F5F9;
    color: #334155;
}

/* Tip at bottom */
.layout-picker-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 13px;
}

.layout-picker-tip svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* ==========================================================================
   DIAGRAM PICKER - INTELIGENTNE DIAGRAMY (GAMMA-STYLE)
   ========================================================================== */

.diagram-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10003;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.diagram-picker-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.diagram-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 560px;
    max-height: 85vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    overflow: hidden;
}

.diagram-picker.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.diagram-picker-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E2E8F0;
}

.diagram-picker-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #0F172A;
}

.diagram-picker-header h3 svg {
    width: 24px;
    height: 24px;
    color: #6366F1;
}

.diagram-picker-header p {
    margin: 0;
    font-size: 14px;
    color: #64748B;
}

.diagram-picker-content {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.diagram-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diagram-option:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    transform: translateY(-2px);
}

.diagram-option.active {
    background: #EEF2FF;
    border-color: #6366F1;
}

.diagram-option-preview {
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-option-preview svg {
    width: 100%;
    height: 100%;
    color: #6366F1;
}

.diagram-option-label {
    font-size: 11px;
    color: #334155;
    text-align: center;
    line-height: 1.3;
}

/* Close button */
.diagram-picker-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #64748B;
    transition: all 0.15s ease;
}

.diagram-picker-close:hover {
    background: #F1F5F9;
    color: #334155;
}

/* Tip */
.diagram-picker-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #EEF2FF;
    color: #4F46E5;
    font-size: 13px;
}

.diagram-picker-tip svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* FIX 2026-01-16: Panel visible by default in step 7 editor */
.gamma-fullscreen-editor .gamma-editor-panel {
    transform: translateX(0) !important;
}

/* ===== QUICK BUTTONS OVERRIDE - MAKE VISIBLE ===== */
.gamma-quick-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%) !important;
    border: 1.5px solid #c7d2fe !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.12) !important;
    color: #1e293b !important;
    font-weight: 500 !important;
}

.gamma-quick-btn:hover {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}

.gamma-quick-btn .icon,
.gamma-quick-btn > span:first-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 13px !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}
/* FIX: Quick buttons 2-column grid */
.gamma-quick-buttons { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; padding: 0 8px !important; }
.gamma-quick-btn { min-width: 0 !important; overflow: hidden !important; padding: 10px 12px !important; font-size: 12px !important; }
/* FIX: gamma-quick-actions 2-column layout */
.gamma-quick-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
