/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
}

body {
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #020617 100%);
    background-attachment: fixed;
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 99px;
    transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2); 
}

.no-scroll-zoom {
    overscroll-behavior: contain;
    touch-action: none;
}

/* Анимации */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

/* Sidebar tab toggle (Заготовки / Мокапы) */
.sidebar-tab-toggle {
    position: relative;
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 0;
    flex: 1;
    margin-right: 8px;
}

.sidebar-tab-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    z-index: 0;
}

.sidebar-tab-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-radius: 8px;
    font-family: inherit;
}

.sidebar-tab-btn.active {
    color: #ffffff;
}

.sidebar-tab-btn:not(.active):hover {
    color: #cbd5e1;
}

.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.2);
}

/* Gallery Grid */
.gallery-grid {
    column-count: 6;
    column-gap: 1.5rem;
    padding-bottom: 2rem;
}

@media (max-width: 1400px) {
    .gallery-grid { column-count: 5; }
}
@media (max-width: 1200px) {
    .gallery-grid { column-count: 4; }
}
@media (max-width: 900px) {
    .gallery-grid { column-count: 3; }
}
@media (max-width: 600px) {
    .gallery-grid { column-count: 2; }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    border-radius: 1rem;
    background: var(--bg-card);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* АДАПТИВНЫЕ СТИЛИ */
@media (max-width: 768px) {
    .responsive-sidebar {
        width: 100% !important;
        max-height: none !important;
        position: relative !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }

    .responsive-layout {
        height: auto !important;
        flex-direction: column !important;
        overflow: auto !important;
        gap: 1rem !important;
    }
    
    .responsive-content {
        height: auto !important;
        overflow: visible !important;
    }

    .responsive-canvas-grid {
        grid-template-columns: 1fr !important;
    }

    .responsive-mockup-container {
        height: auto !important;
        overflow-y: auto !important;
    }

    .responsive-canvas-area {
        height: auto !important;
        overflow-y: auto !important;
        min-height: 300px !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-sidebar {
        width: 100% !important;
        max-height: none !important;
    }

    .responsive-layout {
        height: auto !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .responsive-canvas-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .responsive-canvas-area {
        height: auto !important;
    }
}

/* Десктоп (>=1025px) */
@media (min-width: 1025px) {
    body.app-mode-editor {
        overflow: hidden;
    }

    .responsive-layout {
        height: calc(100vh - 80px) !important;
    }
}
/* ===== УТИЛИТЫ КНОПОК ===== */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: rgb(203, 213, 225);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
    color: white;
}

.btn-icon {
    padding: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.05);
}

.btn-danger {
    color: rgb(248, 113, 113);
    transition: all 0.2s ease;
}

.btn-danger:hover {
    color: rgb(239, 68, 68);
    background: rgba(239, 68, 68, 0.1);
}

/* ===== ЭФФЕКТЫ ВЗАИМОДЕЙСТВИЯ ===== */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-opacity {
    transition: opacity 0.2s ease;
}

.group:hover .hover-opacity-show {
    opacity: 1;
}

.hover-opacity-show {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ===== СОСТОЯНИЯ ВИДИМОСТИ ===== */
.visible-on-hover {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.group:hover .visible-on-hover {
    opacity: 1;
    pointer-events: auto;
}

/* ===== АНИМАЦИИ ЗАГРУЗКИ ===== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== КАРТОЧКИ ПРОДУКТОВ ===== */
.product-card {
    position: relative;
    border-radius: 0.75rem;
    border: 1px solid;
    transition: all 0.2s ease;
}

.product-card-enabled {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgb(51, 65, 85);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.product-card-disabled {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgb(30, 41, 59);
    opacity: 0.75;
}

.product-card-disabled:hover {
    opacity: 1;
}

/* ===== ПОЛЯ ВВОДА ===== */
.input-field {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: white;
    outline: none;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgb(15, 23, 42);
}

.input-field::placeholder {
    color: rgb(71, 85, 105);
}

/* ===== ЧЕКБОКСЫ ===== */
.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-checked {
    background: rgb(99, 102, 241);
    border-color: rgb(99, 102, 241);
    color: white;
}

.checkbox-unchecked {
    border-color: rgb(71, 85, 105);
    background: transparent;
}

.checkbox-unchecked:hover {
    border-color: rgb(100, 116, 139);
}

/* ===== ТАБЫ ===== */
.tab-button {
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-active {
    background: rgba(99, 102, 241, 0.2);
    color: rgb(165, 180, 252);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.tab-inactive {
    color: rgb(148, 163, 184);
}

.tab-inactive:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    aspect-ratio: 1;
    border-radius: 0.375rem;
    border: 2px dashed rgb(71, 85, 105);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(15, 23, 42, 0.5);
    position: relative;
}

.upload-zone:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgb(99, 102, 241);
}

/* ===== BADGE ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: rgb(165, 180, 252);
    border-color: rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(134, 239, 172);
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(252, 165, 165);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===== OVERLAY ===== */
.overlay-dark {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
}

.group:hover .overlay-dark {
    background: rgba(0, 0, 0, 0.4);
}

/* ===== ИКОНКИ ===== */
.icon-wrapper {
    display: inline-flex;
    flex-shrink: 0;
}

/* ===== DIVIDER ===== */
.divider-vertical {
    width: 1px;
    background: rgb(51, 65, 85);
    margin: 0.25rem 0;
}

/* ===== CANVAS GRID ===== */
.responsive-canvas-grid {
    display: grid;
    gap: 1.5rem;
}

/* ===== FILE UPLOADER BUTTONS ===== */
.file-upload-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 2px dashed;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-button-active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
}

.file-upload-button-inactive {
    background: rgb(30, 41, 59);
    border-color: rgb(51, 65, 85);
}

.file-upload-button-inactive:hover {
    border-color: rgb(100, 116, 139);
    background: rgb(51, 65, 85);
}

/* ===== DELETE BUTTON ===== */
.delete-button {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: rgb(15, 23, 42);
    color: rgb(248, 113, 113);
    border: 1px solid rgb(51, 65, 85);
    border-radius: 9999px;
    padding: 0.125rem;
    transition: all 0.2s ease;
}

.delete-button:hover {
    background: rgb(239, 68, 68);
    color: white;
}

/* ===== SEARCH BOX ===== */
.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: rgb(100, 116, 139);
    transition: color 0.2s ease;
}

.search-box:focus-within .search-icon {
    color: rgb(129, 140, 248);
}

.search-box .input-field {
    padding-left: 2.5rem;
}


/* ===== ПРОГРЕСС БАР ===== */
.progress-bar-container {
    width: 100%;
    background: rgb(30, 41, 59);
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, rgb(99, 102, 241), rgb(129, 140, 248));
    transition: width 0.3s ease;
}

/* ===== COLLECTION ITEM ===== */
.collection-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid;
    transition: all 0.2s ease;
    cursor: pointer;
}

.collection-item-selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgb(99, 102, 241);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.collection-item-unselected {
    background: rgba(51, 65, 85, 0.3);
    border-color: rgb(51, 65, 85);
}

.collection-item-unselected:hover {
    border-color: rgb(100, 116, 139);
}

/* ===== CUSTOM SCROLLBAR ===== */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: rgb(15, 23, 42);
    border: 1px solid rgb(99, 102, 241);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    max-width: 20rem;
    z-index: 50;
}

/* ===== THUMBNAIL ===== */
.thumbnail {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgb(15, 23, 42);
    border: 1px solid rgb(51, 65, 85);
    flex-shrink: 0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: rgb(100, 116, 139);
    border: 2px dashed rgb(30, 41, 59);
    border-radius: 0.5rem;
}

/* ===== EDITABLE FIELD ===== */
.editable-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.editable-field:hover .edit-icon {
    opacity: 1;
}

.edit-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ===== СТАТУС БЕЙДЖИ ===== */
.status-saving {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    color: rgb(96, 165, 250);
    font-size: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: rgb(248, 113, 113);
    font-size: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== FOLDERS ===== */
.folder-container {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.folder-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(2px);
}

.folder-item.drag-over {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
    transform: scale(1.02);
}

.folder-icon {
    flex-shrink: 0;
}

.folder-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgb(226, 232, 240);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-size: 0.8rem;
    color: rgb(148, 163, 184);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.folder-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.folder-item:hover .folder-actions {
    opacity: 1;
}

.folder-actions button {
    padding: 0.25rem;
    background: transparent;
    border: none;
    color: rgb(148, 163, 184);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
}

.folder-actions button:hover {
    background: rgba(99, 102, 241, 0.2);
    color: rgb(226, 232, 240);
}

.folder-contents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0.5rem;
    border: 1px dashed rgba(99, 102, 241, 0.2);
}

.folder-item.collapsed .folder-contents {
    display: none;
}

.gallery-item-small {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    border-radius: 0.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.2);
    cursor: grab;
    transition: all 0.2s ease;
}

.gallery-item-small:active {
    cursor: grabbing;
}

.gallery-item-small.dragging {
    opacity: 0.5;
}

.gallery-item-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-folder-input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.5rem;
    color: rgb(226, 232, 240);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.create-folder-input:focus {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Folder Grid updates */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.folder-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    padding: 1rem;
}

.folder-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Modal styles for folder */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 90vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Compact Upload */
.upload-compact {
    border: 2px dashed var(--border);
    background: rgba(30, 41, 59, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-compact:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.5);
}

.folder-file-grid {
    column-count: 4;
    column-gap: 1.5rem;
    padding: 1rem;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .folder-file-grid { column-count: 3; }
}
@media (max-width: 600px) {
    .folder-file-grid { column-count: 2; }
}

/* Hide number input spinners */
input[type=number].no-spinner::-webkit-inner-spin-button, 
input[type=number].no-spinner::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number].no-spinner {
  -moz-appearance: textfield;
}

/* ═══════════════════════════════════════════════════════ */
/* ===== TRANSFORM PANEL (tp-*) — Правая панель мокапов ===== */
/* ═══════════════════════════════════════════════════════ */

.tp-root {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    color: #e2e8f0;
}

/* --- Секция (карточка) --- */
.tp-section {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.tp-section:hover {
    border-color: rgba(99, 102, 241, 0.15);
}

/* --- Заголовок секции --- */
.tp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
    user-select: none;
}
.tp-section-header:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
}

/* --- Тело секции (сворачиваемое) --- */
.tp-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tp-section-body.tp-section-open {
    max-height: 800px;
}
.tp-section-content {
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Пустое состояние --- */
.tp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* --- Группа полей --- */
.tp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tp-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
}

/* --- Селектор рядов --- */
.tp-row-selector {
    display: flex;
    gap: 4px;
}
.tp-row-btn {
    flex: 1;
    padding: 7px 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.5);
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.tp-row-btn:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}
.tp-row-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    border-color: transparent;
}

/* --- Ссылка сброса --- */
.tp-reset-link {
    margin-left: auto;
    color: #ef4444;
    opacity: 0.6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.15s;
}
.tp-reset-link:hover {
    opacity: 1;
}

/* --- Цветовой пикер масок --- */
.tp-color-picker {
    display: flex;
    gap: 6px;
}
.tp-color-swatch {
    flex: 1;
    height: 30px;
    border-radius: 6px;
    border: 2px solid rgba(100, 116, 139, 0.25);
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.55;
}
.tp-color-swatch:hover {
    opacity: 1;
    transform: scale(1.06);
}
.tp-color-swatch.active {
    opacity: 1;
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transform: scale(1.06);
}

/* --- Мини-кнопка иконки (copy/paste) --- */
.tp-icon-btn-sm {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: rgba(15, 23, 42, 0.5);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
}
.tp-icon-btn-sm:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}

/* --- Сетка 2 колонки --- */
.tp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* --- Числовое поле со степпером --- */
.tp-numeric-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tp-numeric-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tp-stepper {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    overflow: hidden;
    height: 34px;
    transition: border-color 0.15s;
}
.tp-stepper:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
}
.tp-stepper-btn {
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}
.tp-stepper-btn:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.15);
}
.tp-stepper-value {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-left: 1px solid rgba(100, 116, 139, 0.15);
    border-right: 1px solid rgba(100, 116, 139, 0.15);
}
.tp-stepper-input {
    background: transparent;
    text-align: center;
    font-size: 14px;
    color: #e2e8f0;
    border: none;
    outline: none;
    padding: 0;
    font-family: inherit;
    font-weight: 500;
}
.tp-stepper-unit {
    position: absolute;
    right: 3px;
    font-size: 11px;
    color: #64748b;
    pointer-events: none;
}

/* --- Слайдер --- */
.tp-range-slider {
    width: 100%;
    height: 4px;
    background: #1e293b;
    border-radius: 99px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    margin: 2px 0;
}
.tp-range-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: 2px solid #1e293b;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
    transition: transform 0.1s;
}
.tp-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.tp-range-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: 2px solid #1e293b;
    cursor: pointer;
}

/* --- Быстрый поворот --- */
.tp-quick-rotate {
    display: flex;
    gap: 3px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: 8px;
    padding: 3px;
}
.tp-rotate-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s;
    font-family: inherit;
}
.tp-rotate-btn:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.15);
}
.tp-rotate-reset {
    color: #64748b;
}
.tp-rotate-reset:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* --- Кнопки действий (Центр / Сброс) --- */
.tp-action-row {
    display: flex;
    gap: 6px;
}
.tp-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    background: rgba(15, 23, 42, 0.4);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.tp-action-btn:hover {
    color: #e2e8f0;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}
.tp-action-danger:hover {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

/* --- Пресеты --- */
.tp-preset-save {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tp-preset-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #e2e8f0;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}
.tp-preset-input::placeholder {
    color: #475569;
}
.tp-preset-input:focus {
    border-color: rgba(99, 102, 241, 0.5);
}
.tp-preset-save-btns {
    display: flex;
    gap: 6px;
}
.tp-preset-save-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.tp-preset-single {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}
.tp-preset-single:hover {
    background: rgba(99, 102, 241, 0.25);
}
.tp-preset-all {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.25);
    color: #c4b5fd;
}
.tp-preset-all:hover {
    background: rgba(168, 85, 247, 0.25);
}

/* Список пресетов */
.tp-preset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tp-preset-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.tp-preset-count {
    background: rgba(100, 116, 139, 0.15);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    color: #94a3b8;
}
.tp-preset-scroll {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.tp-preset-scroll::-webkit-scrollbar {
    width: 4px;
}
.tp-preset-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
}
.tp-preset-item {
    display: flex;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.12);
    border-radius: 7px;
    overflow: hidden;
    min-height: 34px;
    transition: border-color 0.12s;
}
.tp-preset-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
}
.tp-preset-name {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 13px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.tp-preset-actions {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}
.tp-preset-apply,
.tp-preset-apply-all,
.tp-preset-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.12s;
    font-size: 0;
}
.tp-preset-apply {
    color: #64748b;
    border-left: 1px solid rgba(100, 116, 139, 0.1);
}
.tp-preset-apply:hover {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
}
.tp-preset-apply-all {
    color: #64748b;
    border-left: 1px solid rgba(100, 116, 139, 0.1);
}
.tp-preset-apply-all:hover {
    color: #a78bfa;
    background: rgba(168, 85, 247, 0.1);
}
.tp-preset-delete {
    color: #475569;
    border-left: 1px solid rgba(100, 116, 139, 0.1);
}
.tp-preset-delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
}
