/* ===========================================
   T-Shirt Designer - Styles
   =========================================== */

/* Toolbar */
.td-toolbar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px;
    position: sticky;
    top: 100px;
}

.td-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.td-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.td-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    margin-bottom: 15px;
}

/* Color Swatches */
.td-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.td-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.td-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.td-swatch.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.3);
}

.td-swatch[data-color="#ffffff"],
.td-swatch[data-color="#f1c40f"] {
    border-color: #ccc;
}

.td-swatch[data-color="#ffffff"].active,
.td-swatch[data-color="#f1c40f"].active {
    border-color: #007bff;
}

/* Text Controls */
.td-color-input {
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

.td-style-toggles {
    display: flex;
    gap: 6px;
}

.td-style-toggles .btn {
    flex: 1;
    font-size: 14px;
}

.td-style-toggles .btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Upload Drop Zone */
.td-dropzone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.td-dropzone:hover,
.td-dropzone.drag-over {
    border-color: #007bff;
    background: #f0f7ff;
}

.td-dropzone i {
    font-size: 32px;
    color: #999;
    display: block;
    margin-bottom: 8px;
}

.td-dropzone p {
    margin: 0 0 5px;
    color: #666;
    font-size: 14px;
}

/* Layers Panel */
.td-layers-list {
    max-height: 200px;
    overflow-y: auto;
}

.td-layers-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 15px 0;
}

.td-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.td-layer-item:hover {
    background: #f5f5f5;
}

.td-layer-item.active {
    background: #e8f0fe;
    border-color: #007bff;
}

.td-layer-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.td-layer-item-icon {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #888;
}

.td-layer-controls {
    display: flex;
    gap: 4px;
}

.td-layer-controls button {
    background: none;
    border: none;
    padding: 2px 5px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    border-radius: 3px;
}

.td-layer-controls button:hover {
    background: #e0e0e0;
    color: #333;
}

/* Actions Grid */
.td-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.td-actions-grid .btn {
    font-size: 12px;
    padding: 6px 8px;
}

/* Canvas Area */
.td-canvas-area {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* View Toggle */
.td-view-toggle {
    display: flex;
    gap: 4px;
}

/* T-Shirt Container */
.td-shirt-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

#tshirtSVG {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

/* Canvas Wrapper (positioned over chest) */
.td-canvas-wrapper {
    position: absolute;
    top: 18%;
    left: 26%;
    width: 48%;
    height: 52%;
}

.td-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.td-canvas-hint small {
    font-size: 12px;
}

/* Mobile Tab Nav */
.td-mobile-tabs {
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    display: flex;
    justify-content: space-around;
}

.td-mobile-tabs .nav-link {
    padding: 10px 15px;
    font-size: 18px;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.td-mobile-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: none;
}

/* Desktop: show all sections, hide tabs */
@media (min-width: 992px) {
    .td-mobile-tabs {
        display: none !important;
    }
    .tab-content > .tab-pane {
        display: block;
        opacity: 1;
    }
    /* Override Bootstrap tab behavior for desktop */
    .tab-content > .tab-pane.fade {
        opacity: 1;
    }
}

/* Mobile: use tab behavior */
@media (max-width: 991px) {
    .td-toolbar {
        position: static;
        margin-bottom: 15px;
    }

    .tab-content > .tab-pane.active-lg {
        display: none;
        opacity: 0;
    }

    .tab-content > .tab-pane.active.show {
        display: block;
        opacity: 1;
    }

    .td-canvas-area {
        min-height: 400px;
        padding: 15px;
    }

    .td-shirt-container {
        max-width: 360px;
    }
}

@media (max-width: 576px) {
    .td-shirt-container {
        max-width: 300px;
    }

    .td-swatches {
        gap: 6px;
    }

    .td-swatch {
        width: 30px;
        height: 30px;
    }

    .td-actions-grid {
        grid-template-columns: 1fr;
    }
}
