/**
 * T-Shirt Customizer — Estilos
 * Design profissional, limpo e moderno.
 * Compatível com Elementor e temas modernos.
 */

/* ─────────────────────────────────────────────
   Variáveis CSS
───────────────────────────────────────────── */
:root {
    --tsc-primary:        #F5C518;
    --tsc-primary-hover:  #E0B015;
    --tsc-primary-light:  #FFF9E6;
    --tsc-success:        #16A34A;
    --tsc-success-light:  #F0FDF4;
    --tsc-error:          #DC2626;
    --tsc-error-light:    #FEF2F2;
    --tsc-border:         #E2E8F0;
    --tsc-border-hover:   #94A3B8;
    --tsc-text:           #1E293B;
    --tsc-text-muted:     #64748B;
    --tsc-bg:             #FFFFFF;
    --tsc-bg-subtle:      #F8FAFC;
    --tsc-radius:         12px;
    --tsc-radius-sm:      8px;
    --tsc-shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --tsc-shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --tsc-transition:     all .2s ease;
    --tsc-font:           inherit;
}

/* ─────────────────────────────────────────────
   Utilitários
───────────────────────────────────────────── */
.tsc-hidden {
    display: none !important;
}

/* ─────────────────────────────────────────────
   Wrapper principal
───────────────────────────────────────────── */
.tsc-upload-wrapper {
    font-family: var(--tsc-font);
    color: var(--tsc-text);
    border: 2px solid var(--tsc-border);
    border-radius: var(--tsc-radius);
    padding: 28px;
    margin: 24px 0;
    background: var(--tsc-bg);
    box-shadow: var(--tsc-shadow);
    transition: var(--tsc-transition);
}

.tsc-upload-wrapper:hover {
    border-color: var(--tsc-primary);
    box-shadow: var(--tsc-shadow-md);
}

/* ─────────────────────────────────────────────
   Header
───────────────────────────────────────────── */
.tsc-upload-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tsc-border);
}

.tsc-upload-icon {
    width: 56px;
    height: 56px;
    background: var(--tsc-primary-light);
    border-radius: var(--tsc-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tsc-primary);
    flex-shrink: 0;
}

.tsc-upload-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--tsc-text);
    line-height: 1.3;
}

.tsc-upload-header p {
    margin: 0;
    font-size: 14px;
    color: var(--tsc-text-muted);
}

/* ─────────────────────────────────────────────
   Labels e campos
───────────────────────────────────────────── */
.tsc-field-group {
    margin-bottom: 20px;
}

.tsc-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tsc-text);
    margin-bottom: 8px;
}

.tsc-required {
    color: var(--tsc-error);
    margin-left: 2px;
}

.tsc-optional {
    color: var(--tsc-text-muted);
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

/* ─────────────────────────────────────────────
   Seletor de área de impressão
───────────────────────────────────────────── */
.tsc-print-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tsc-area-option {
    cursor: pointer;
}

.tsc-area-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tsc-area-label {
    display: inline-block;
    padding: 8px 16px;
    border: 2px solid var(--tsc-border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tsc-text-muted);
    background: var(--tsc-bg);
    cursor: pointer;
    transition: var(--tsc-transition);
    user-select: none;
}

.tsc-area-option--active .tsc-area-label,
.tsc-area-radio:checked + .tsc-area-label {
    border-color: var(--tsc-primary);
    color: var(--tsc-primary);
    background: var(--tsc-primary-light);
    font-weight: 600;
}

.tsc-area-label:hover {
    border-color: var(--tsc-border-hover);
    color: var(--tsc-text);
}

/* ─────────────────────────────────────────────
   Dropzone
───────────────────────────────────────────── */
.tsc-dropzone {
    border: 2px dashed var(--tsc-border);
    border-radius: var(--tsc-radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--tsc-bg-subtle);
    transition: var(--tsc-transition);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tsc-dropzone:hover,
.tsc-dropzone:focus-within {
    border-color: var(--tsc-primary);
    background: var(--tsc-primary-light);
    outline: none;
}

.tsc-dropzone--active {
    border-color: var(--tsc-primary);
    background: var(--tsc-primary-light);
    transform: scale(1.01);
}

.tsc-dropzone--loading {
    cursor: wait;
    pointer-events: none;
}

.tsc-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tsc-dropzone-icon {
    color: var(--tsc-primary);
    opacity: .7;
}

.tsc-dropzone-text {
    margin: 0;
    font-size: 15px;
    color: var(--tsc-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tsc-dropzone-or {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--tsc-text-muted);
    opacity: .6;
}

.tsc-dropzone-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--tsc-text-muted);
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Botões
───────────────────────────────────────────── */
.tsc-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--tsc-primary);
    color: #1A1A1A;
    border: none;
    border-radius: var(--tsc-radius-sm);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tsc-transition);
    text-decoration: none;
    line-height: 1;
}

.tsc-btn-primary:hover {
    background: var(--tsc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 197, 24, .4);
}

.tsc-btn-primary:active {
    transform: translateY(0);
}

.tsc-btn-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--tsc-error-light);
    color: var(--tsc-error);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tsc-transition);
    flex-shrink: 0;
    margin-left: auto;
}

.tsc-btn-remove:hover {
    background: var(--tsc-error);
    color: #fff;
}

/* ─────────────────────────────────────────────
   Loading spinner
───────────────────────────────────────────── */
.tsc-dropzone-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tsc-dropzone-loading p {
    margin: 0;
    font-size: 14px;
    color: var(--tsc-text-muted);
}

.tsc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--tsc-border);
    border-top-color: var(--tsc-primary);
    border-radius: 50%;
    animation: tsc-spin .7s linear infinite;
}

@keyframes tsc-spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   Preview do design carregado
───────────────────────────────────────────── */
.tsc-design-preview {
    background: var(--tsc-success-light);
    border: 2px solid #86EFAC;
    border-radius: var(--tsc-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.tsc-preview-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tsc-preview-icon {
    width: 32px;
    height: 32px;
    background: var(--tsc-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.tsc-preview-details {
    flex: 1;
    min-width: 0;
}

.tsc-preview-details strong {
    display: block;
    font-size: 13px;
    color: var(--tsc-success);
    margin-bottom: 2px;
}

.tsc-file-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tsc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tsc-print-area {
    display: inline-block;
    font-size: 12px;
    background: #fff;
    color: var(--tsc-success);
    border: 1px solid #86EFAC;
    border-radius: 100px;
    padding: 2px 8px;
    margin-top: 4px;
    font-weight: 500;
}

.tsc-preview-image {
    display: block;
    max-width: 120px;
    max-height: 120px;
    border-radius: var(--tsc-radius-sm);
    margin-top: 12px;
    object-fit: contain;
    border: 1px solid var(--tsc-border);
}

/* ─────────────────────────────────────────────
   Textarea
───────────────────────────────────────────── */
.tsc-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--tsc-border);
    border-radius: var(--tsc-radius-sm);
    font-size: 14px;
    font-family: var(--tsc-font);
    color: var(--tsc-text);
    resize: vertical;
    transition: var(--tsc-transition);
    box-sizing: border-box;
}

.tsc-textarea:focus {
    outline: none;
    border-color: var(--tsc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.tsc-textarea::placeholder {
    color: var(--tsc-text-muted);
    opacity: .6;
}

.tsc-field-group--notes {
    margin-top: 20px;
}

/* ─────────────────────────────────────────────
   Mensagens de feedback
───────────────────────────────────────────── */
.tsc-messages {
    margin-top: 12px;
}

.tsc-message {
    padding: 12px 16px;
    border-radius: var(--tsc-radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.tsc-message--success {
    background: var(--tsc-success-light);
    color: var(--tsc-success);
    border-color: #86EFAC;
}

.tsc-message--error {
    background: var(--tsc-error-light);
    color: var(--tsc-error);
    border-color: #FCA5A5;
}

.tsc-message--info {
    background: var(--tsc-primary-light);
    color: var(--tsc-primary);
    border-color: #BFDBFE;
}

/* ─────────────────────────────────────────────
   Admin — Meta Box e Ordem
───────────────────────────────────────────── */
.tsc-meta-box {
    padding: 4px 0;
}

.tsc-meta-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.tsc-order-design {
    margin-top: 10px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.tsc-design-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 13px;
}

.tsc-design-table th {
    width: 120px;
    text-align: left;
    padding: 4px 8px 4px 0;
    color: #64748b;
    font-weight: 500;
}

.tsc-design-table td {
    padding: 4px 0;
    color: #1e293b;
    font-weight: 600;
}

.tsc-status-select {
    font-size: 13px;
    padding: 3px 6px;
}

.tsc-btn-download {
    font-size: 13px;
}

/* ─────────────────────────────────────────────
   Responsivo
───────────────────────────────────────────── */
@media (max-width: 600px) {
    .tsc-upload-wrapper {
        padding: 20px 16px;
    }

    .tsc-upload-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .tsc-dropzone {
        padding: 28px 16px;
    }

    .tsc-print-areas {
        gap: 6px;
    }

    .tsc-area-label {
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* ─────────────────────────────────────────────
   Multi-área — Checkboxes de seleção
───────────────────────────────────────────── */
.tsc-area-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Área selecionada (checked) */
.tsc-area-checkbox:checked + .tsc-area-label {
    border-color: var(--tsc-primary);
    color: #1A1A1A;
    background: var(--tsc-primary);
    font-weight: 700;
}

/* Área já com upload concluído */
.tsc-area-option--done .tsc-area-label {
    border-color: var(--tsc-success);
    color: var(--tsc-success);
    background: var(--tsc-success-light);
}

.tsc-area-check {
    margin-right: 4px;
    font-weight: 700;
}

/* ─────────────────────────────────────────────
   Multi-área — Bloco de upload por área
───────────────────────────────────────────── */
.tsc-area-upload {
    border: 2px solid var(--tsc-border);
    border-radius: var(--tsc-radius);
    padding: 20px;
    margin-bottom: 16px;
    background: var(--tsc-bg-subtle);
    transition: var(--tsc-transition);
}

.tsc-area-upload--done {
    border-color: #86EFAC;
    background: var(--tsc-success-light);
}

.tsc-area-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tsc-area-upload-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tsc-text);
}

.tsc-area-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--tsc-border);
    color: var(--tsc-text-muted);
}

.tsc-area-badge--done {
    background: var(--tsc-success);
    color: #fff;
}

/* Dropzone dentro do bloco de área — mais compacto */
.tsc-area-upload .tsc-dropzone {
    min-height: 140px;
    padding: 24px 16px;
}

.tsc-step {
    margin-bottom: 20px;
}

/* Botão confirmar áreas com espaço acima */
#tsc-btn-confirm-areas {
    margin-top: 16px;
    width: 100%;
    justify-content: center;
}
