/* ===== 123triko Designer – Nalepshop Style ===== */

/* Reset for overlay */
.ttk-overlay *, .ttk-overlay *::before, .ttk-overlay *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== Open Button ===== */
.ttk-open-designer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #3DC47E;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    margin: 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ttk-open-designer-btn:hover {
    background: #33a86b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61,196,126,0.3);
    color: #fff !important;
}

/* ===== Overlay ===== */
.ttk-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #f5f0ea;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}
.ttk-overlay.active {
    display: flex;
}

/* ===== TOP BAR ===== */
.ttk-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    background: #faf8f5;
    border-bottom: 1px solid #e8e4de;
    flex-shrink: 0;
}
.ttk-topbar-left, .ttk-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Product tabs */
.ttk-product-tabs {
    display: flex;
    gap: 4px;
}
.ttk-product-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.ttk-product-tab:hover { background: #eee8e0; }
.ttk-product-tab.active {
    background: #2a2a2a;
    color: #fff;
}

/* Side toggle */
.ttk-side-toggle {
    display: flex;
    background: #eee8e0;
    border-radius: 50px;
    padding: 2px;
}
.ttk-side-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.ttk-side-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Topbar buttons */
.ttk-topbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 50px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.ttk-topbar-btn:hover { background: #f5f5f5; border-color: #ccc; }

.ttk-close-btn:hover { border-color: #e74c3c; color: #e74c3c; }

.ttk-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    background: #3DC47E;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.ttk-submit-btn:hover { background: #33a86b; }
.ttk-submit-btn:disabled { opacity: 0.5; cursor: wait; }

/* ===== COLOR BAR ===== */
.ttk-colorbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    background: #faf8f5;
    border-bottom: 1px solid #e8e4de;
    flex-shrink: 0;
}
.ttk-colorbar-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #888;
    white-space: nowrap;
}
.ttk-color-swatches {
    display: flex;
    gap: 8px;
}
.ttk-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e0dcd6;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}
.ttk-swatch:hover { transform: scale(1.15); }
.ttk-swatch.active {
    border-color: #3DC47E;
    box-shadow: 0 0 0 2px #3DC47E;
}

/* ===== MAIN AREA ===== */
.ttk-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== CANVAS AREA ===== */
.ttk-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eee8e0;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* Mini toolbar */
.ttk-mini-toolbar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 10;
}
.ttk-mini-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ttk-mini-btn:hover { background: #f0f0f0; color: #333; }
.ttk-mini-danger:hover { background: #fee; color: #e74c3c; }
.ttk-mini-sep {
    width: 1px;
    height: 20px;
    background: #e0e0e0;
    margin: 0 4px;
}

/* Mockup container */
.ttk-mockup-container {
    position: relative;
    width: 420px;
    height: 510px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ttk-tshirt-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.08));
}
.ttk-print-area {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 45%;
    border: 2px dashed rgba(0,0,0,0.15);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ttk-print-area canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Placeholder */
.ttk-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #3DC47E;
    color: #fff;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
    white-space: nowrap;
}
.ttk-placeholder:hover {
    background: #33a86b;
    transform: translate(-50%, -50%) scale(1.03);
}
.ttk-placeholder.hidden { display: none; }

/* ===== SIDEBAR ===== */
.ttk-sidebar {
    width: 320px;
    background: #faf8f5;
    border-left: 1px solid #e8e4de;
    overflow-y: auto;
    flex-shrink: 0;
}
.ttk-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e4de;
}

/* Accordion */
.ttk-accordion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-bottom: 1px solid #e8e4de;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #555;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}
.ttk-accordion-header:hover { background: #f0ece5; }
.ttk-accordion-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.ttk-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}
.ttk-accordion-header.open .ttk-chevron {
    transform: rotate(180deg);
}

.ttk-accordion-body {
    display: none;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e4de;
}
.ttk-accordion-body.open { display: block; }

/* Subtabs */
.ttk-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: #eee8e0;
    border-radius: 50px;
    padding: 3px;
}
.ttk-subtab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    transition: all 0.15s;
}
.ttk-subtab.active {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ttk-aitab-content { display: none; }
.ttk-aitab-content.active { display: block; }

/* Style pills */
.ttk-style-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.ttk-pill {
    padding: 7px 14px;
    border: 1.5px solid #ddd;
    border-radius: 50px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.ttk-pill:hover { border-color: #3DC47E; }
.ttk-pill.selected {
    border-color: #3DC47E;
    background: #e8f9ef;
    color: #2a8a56;
}

/* Inputs */
.ttk-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.ttk-input:focus {
    outline: none;
    border-color: #3DC47E;
}
.ttk-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-family: inherit;
}

/* Green button */
.ttk-green-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 50px;
    background: #3DC47E;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.ttk-green-btn:hover { background: #33a86b; }
.ttk-green-btn:disabled { opacity: 0.5; cursor: wait; }
.ttk-green-outline {
    background: transparent;
    border: 2px solid #3DC47E;
    color: #3DC47E;
}
.ttk-green-outline:hover {
    background: #3DC47E;
    color: #fff;
}

/* Status */
.ttk-status {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    min-height: 20px;
}
.ttk-status.success { color: #3DC47E; }
.ttk-status.error { color: #e74c3c; }

/* Spinner */
.ttk-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ttk-spin 0.6s linear infinite;
}
@keyframes ttk-spin { to { transform: rotate(360deg); } }

/* Text options */
.ttk-field-row {
    margin-bottom: 12px;
}
.ttk-field-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ttk-range {
    width: 100%;
    accent-color: #3DC47E;
}
.ttk-range-val {
    font-size: 13px;
    color: #555;
    margin-left: 8px;
}
.ttk-text-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ttk-text-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}
.ttk-text-color:hover { transform: scale(1.15); }
.ttk-text-color.active { border-color: #3DC47E; box-shadow: 0 0 0 2px #3DC47E; }

.ttk-align-btns, .ttk-style-btns {
    display: flex;
    gap: 4px;
}
.ttk-align-btn, .ttk-style-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.ttk-align-btn:hover, .ttk-style-btn:hover { border-color: #3DC47E; }
.ttk-align-btn.active, .ttk-style-btn.active {
    background: #3DC47E;
    border-color: #3DC47E;
    color: #fff;
}

/* Upload zone */
.ttk-upload-zone {
    border: 2px dashed #d0ccc5;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}
.ttk-upload-zone:hover {
    border-color: #3DC47E;
    background: #f0faf4;
}
.ttk-upload-zone p {
    margin: 8px 0 4px;
    font-size: 14px;
    color: #666;
}
.ttk-upload-zone small {
    font-size: 12px;
    color: #aaa;
}

/* Layers */
.ttk-layers-list {
    max-height: 200px;
    overflow-y: auto;
}
.ttk-layers-empty {
    color: #aaa;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}
.ttk-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
    color: #555;
}
.ttk-layer-item:hover { background: #f0ece5; }
.ttk-layer-item.active { background: #e8f9ef; color: #2a8a56; }
.ttk-layer-delete {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
}
.ttk-layer-delete:hover { color: #e74c3c; background: #fee; }

/* ===== BOTTOM BAR ===== */
.ttk-bottombar {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #faf8f5;
    border-top: 1px solid #e8e4de;
    flex-shrink: 0;
}
.ttk-bottombar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ttk-main { flex-direction: column; }
    .ttk-sidebar {
        width: 100%;
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid #e8e4de;
    }
    .ttk-mockup-container {
        width: 280px;
        height: 340px;
    }
    .ttk-topbar-left { gap: 6px; }
    .ttk-product-tab span { display: none; }
}

@media (max-width: 600px) {
    .ttk-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 8px;
    }
    .ttk-colorbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .ttk-color-swatches {
        flex-wrap: wrap;
    }
}
