/* T-Shirt Design Tool - Frontend Styles */
:root {
    --tsdt-primary: #4361ee;
    --tsdt-primary-dark: #3a56d4;
    --tsdt-secondary: #3f37c9;
    --tsdt-accent: #4cc9f0;
    --tsdt-light: #f8f9fa;
    --tsdt-dark: #212529;
    --tsdt-gray: #6c757d;
    --tsdt-success: #4caf50;
    --tsdt-danger: #f44336;
    --tsdt-warning: #ff9800;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #f5f7ff;
    color: var(--tsdt-dark);
    line-height: 1.6;
    overflow-x: hidden;
}
.tsdt-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.tsdt-header {
    background: linear-gradient(135deg, var(--tsdt-primary), var(--tsdt-secondary));
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.tsdt-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
}
.tsdt-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}
.tsdt-logo i {
    color: var(--tsdt-accent);
    font-size: 1.5rem;
}
.tsdt-header-actions {
    display: flex;
    gap: 0.5rem;
}
.tsdt-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}
.tsdt-btn-primary {
    background-color: var(--tsdt-accent);
    color: var(--tsdt-dark);
}
.tsdt-btn-primary:hover {
    background-color: #3db8e0;
}
.tsdt-btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}
.tsdt-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
.tsdt-btn-danger {
    background-color: var(--tsdt-danger);
    color: white;
}
.tsdt-btn-danger:hover {
    background-color: #d32f2f;
}
.tsdt-btn-success {
    background-color: var(--tsdt-success);
    color: white;
}
.tsdt-btn-success:hover {
    background-color: #388e3c;
}
.tsdt-main {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
    gap: 1rem;
    flex-direction: column;
}
.tsdt-mobile-tabs {
    display: none;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.tsdt-mobile-tabs::-webkit-scrollbar {
    height: 4px;
}
.tsdt-mobile-tabs::-webkit-scrollbar-thumb {
    background: var(--tsdt-gray);
    border-radius: 2px;
}
.tsdt-tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--tsdt-gray);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.tsdt-tab-btn.active {
    color: var(--tsdt-primary);
    border-bottom-color: var(--tsdt-primary);
}
.tsdt-tab-btn i {
    font-size: 1rem;
}
.tsdt-sidebar {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    margin-bottom: 1rem;
    order: 2;
}
.tsdt-sidebar h2 {
    margin-bottom: 1rem;
    color: var(--tsdt-primary);
    font-size: 1.1rem;
    border-bottom: 2px solid var(--tsdt-light);
    padding-bottom: 0.5rem;
}
.tsdt-control-group {
    margin-bottom: 1.5rem;
}
.tsdt-control-group h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--tsdt-dark);
}

/* Carousel Styles */
.tsdt-templates-carousel {
    position: relative;
    overflow: hidden;
    margin: 0 -1rem;
    padding: 0 1rem;
}
.tsdt-templates-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 1rem;
}
.tsdt-template-btn {
    flex: 0 0 calc(50% - 0.5rem);
    aspect-ratio: 3/4;
    border: 2px solid var(--tsdt-light);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.tsdt-template-btn:hover {
    border-color: var(--tsdt-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.tsdt-template-btn.active {
    border-color: var(--tsdt-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}
.tsdt-template-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tsdt-carousel-prev,
.tsdt-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tsdt-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}
.tsdt-carousel-prev {
    left: 0.5rem;
}
.tsdt-carousel-next {
    right: 0.5rem;
}
.tsdt-carousel-prev:hover,
.tsdt-carousel-next:hover {
    background: var(--tsdt-primary-dark);
}
.tsdt-carousel-prev svg,
.tsdt-carousel-next svg {
    width: 18px;
    height: 18px;
}

/* Rest of the CSS remains unchanged */
.tsdt-upload-area {
    border: 2px dashed var(--tsdt-gray);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}
.tsdt-upload-area:hover {
    border-color: var(--tsdt-primary);
    background-color: rgba(67, 97, 238, 0.05);
}
.tsdt-upload-area i {
    font-size: 1.5rem;
    color: var(--tsdt-primary);
    margin-bottom: 0.5rem;
}
.tsdt-upload-area p {
    margin: 0;
    color: var(--tsdt-gray);
    font-size: 0.85rem;
}
.tsdt-file-input {
    display: none !important;
}
.tsdt-blend-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.tsdt-blend-option {
    padding: 0.5rem;
    border: 1px solid var(--tsdt-light);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}
.tsdt-blend-option:hover {
    background-color: var(--tsdt-light);
}
.tsdt-blend-option.active {
    background-color: var(--tsdt-primary);
    color: white;
    border-color: var(--tsdt-primary);
}
.tsdt-slider-container {
    margin-top: 1rem;
}
.tsdt-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--tsdt-light);
    outline: none;
    -webkit-appearance: none;
}
.tsdt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tsdt-primary);
    cursor: pointer;
}
.tsdt-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--tsdt-primary);
    cursor: pointer;
    border: none;
}
.tsdt-zoom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.tsdt-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tsdt-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-zoom-btn:hover {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-zoom-btn svg {
    width: 18px;
    height: 18px;
}
.tsdt-quality-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tsdt-quality-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--tsdt-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-quality-option:hover {
    background-color: var(--tsdt-light);
}
.tsdt-quality-option.active {
    background-color: var(--tsdt-primary);
    color: white;
    border-color: var(--tsdt-primary);
}
.tsdt-quality-option input {
    margin-right: 0.5rem;
}
.tsdt-quality-info {
    font-size: 0.75rem;
    color: var(--tsdt-gray);
    margin-left: auto;
}
.tsdt-canvas-area {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    order: 1;
    min-height: 400px;
}
.tsdt-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tsdt-canvas-title {
    font-size: 1.1rem;
    color: var(--tsdt-dark);
}
.tsdt-canvas-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tsdt-canvas-actions .tsdt-btn {
    background-color: var(--tsdt-light);
    color: var(--tsdt-dark);
    border: 1px solid #dee2e6;
}
.tsdt-canvas-actions .tsdt-btn:hover {
    background-color: #e9ecef;
}
.tsdt-canvas-actions .tsdt-btn-danger {
    background-color: var(--tsdt-danger);
    color: white;
    border: 1px solid var(--tsdt-danger);
}
.tsdt-canvas-actions .tsdt-btn-danger:hover {
    background-color: #d32f2f;
}
.tsdt-canvas-actions .tsdt-btn-primary {
    background-color: var(--tsdt-primary);
    color: white;
    border: 1px solid var(--tsdt-primary);
}
.tsdt-canvas-actions .tsdt-btn-primary:hover {
    background-color: var(--tsdt-primary-dark);
}
.tsdt-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 6px;
    position: relative;
    overflow: auto;
    min-height: 350px;
    -webkit-overflow-scrolling: touch;
}
.tsdt-tshirt-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3/4;
    margin: 1rem;
    background: white;
}
.tsdt-tshirt-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
.tsdt-design-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.tsdt-design-image {
    max-width: 70%;
    max-height: 40%;
    object-fit: contain;
    cursor: move;
    transition: transform 0.2s ease;
    mix-blend-mode: normal;
    pointer-events: all;
    user-select: none;
    position: absolute;
}
.tsdt-position-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 3;
}
.tsdt-position-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--tsdt-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-position-btn:hover {
    background: var(--tsdt-primary);
    color: white;
    border-color: var(--tsdt-primary);
}
.tsdt-position-btn svg {
    width: 18px;
    height: 18px;
}
.tsdt-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--tsdt-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
}
.tsdt-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.tsdt-toast.success {
    background: var(--tsdt-success);
}
.tsdt-toast.error {
    background: var(--tsdt-danger);
}
.tsdt-toast.warning {
    background: var(--tsdt-warning);
}
.tsdt-hidden {
    display: none;
}
.tsdt-resize-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tsdt-resize-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--tsdt-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-resize-btn:hover {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-resize-btn svg {
    width: 16px;
    height: 16px;
}
.tsdt-rotation-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tsdt-rotation-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--tsdt-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-rotation-btn:hover {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-rotation-btn svg {
    width: 16px;
    height: 16px;
}
.tsdt-flip-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.tsdt-flip-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--tsdt-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-flip-btn:hover {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-flip-btn svg {
    width: 16px;
    height: 16px;
}
.tsdt-align-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.tsdt-align-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--tsdt-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tsdt-align-btn:hover {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-align-btn.active {
    background: var(--tsdt-primary);
    color: white;
}
.tsdt-align-btn svg {
    width: 16px;
    height: 16px;
}
.tsdt-no-templates, .tsdt-error {
    text-align: center;
    padding: 20px;
    color: var(--tsdt-gray);
    font-style: italic;
    grid-column: 1 / -1;
}

/* Desktop Styles */
@media (min-width: 992px) {
    .tsdt-main {
        flex-direction: row;
        padding: 1.5rem;
    }
    .tsdt-mobile-tabs {
        display: none;
    }
    .tsdt-sidebar {
        width: 320px;
        position: sticky;
        top: 1.5rem;
        height: calc(100vh - 6rem);
        margin-bottom: 0;
        order: 1;
        overflow-y: auto;
        padding-right: 0.5rem;
    }
    .tsdt-sidebar::-webkit-scrollbar {
        width: 6px;
    }
    .tsdt-sidebar::-webkit-scrollbar-thumb {
        background: var(--tsdt-gray);
        border-radius: 3px;
    }
    .tsdt-canvas-area {
        order: 2;
        height: calc(100vh - 6rem);
    }
    .tsdt-templates-carousel {
        margin: 0;
        padding: 0;
    }
    .tsdt-template-btn {
        flex: 0 0 calc(50% - 0.5rem);
    }
    .tsdt-blend-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .tsdt-tshirt-container {
        max-width: 500px;
        margin: 0;
    }
    .tsdt-canvas-container {
        min-height: 500px;
        overflow: hidden;
    }
    .tsdt-position-controls {
        position: static;
        transform: none;
        margin-top: 1rem;
        align-self: center;
    }
    .tsdt-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .tsdt-logo {
        font-size: 1.5rem;
    }
    .tsdt-logo i {
        font-size: 1.75rem;
    }
    .tsdt-header-actions {
        gap: 1rem;
    }
    .tsdt-sidebar h2 {
        font-size: 1.25rem;
    }
    .tsdt-control-group {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--tsdt-light);
    }
    .tsdt-control-group:last-child {
        border-bottom: none;
    }
    .tsdt-control-group h3 {
        font-size: 1rem;
    }
    .tsdt-upload-area {
        padding: 1rem;
    }
    .tsdt-upload-area i {
        font-size: 1.75rem;
    }
    .tsdt-upload-area p {
        font-size: 0.9rem;
    }
    .tsdt-blend-option {
        font-size: 0.85rem;
    }
    .tsdt-canvas-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile Styles */
@media (max-width: 576px) {
    .tsdt-header-content {
        flex-direction: column;
        gap: 1rem;
    }
    .tsdt-canvas-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tsdt-mobile-tabs {
        display: block;
    }
    .tsdt-sidebar {
        border-radius: 0 0 8px 8px;
    }
    .tsdt-template-btn {
        flex: 0 0 calc(50% - 0.5rem);
    }
    .tsdt-blend-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .tsdt-position-controls {
        bottom: 10px;
        gap: 5px;
    }
    .tsdt-position-btn {
        width: 32px;
        height: 32px;
    }
    .tsdt-zoom-btn {
        width: 32px;
        height: 32px;
    }
    .tsdt-btn {
        font-size: 0.8rem;
    }
    .tsdt-canvas-title {
        font-size: 1rem;
    }
    .tsdt-canvas-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    .tsdt-canvas-actions .tsdt-btn {
        width: 100%;
        justify-content: center;
    }
    .tsdt-canvas-actions .tsdt-btn-danger {
        order: 1;
    }
    .tsdt-canvas-actions .tsdt-btn-primary {
        order: 2;
    }
    .tsdt-canvas-actions .tsdt-btn-secondary {
        order: 3;
    }
}

/* Tablet Styles */
@media (min-width: 577px) and (max-width: 991px) {
    .tsdt-template-btn {
        flex: 0 0 calc(50% - 0.5rem);
    }
    .tsdt-blend-options {
        grid-template-columns: repeat(3, 1fr);
    }
}