:root {
    --image-text-pink: #ec4899;
    --image-text-light: #FCE7F3;
    --image-text-dark: #db2777;
}

.image-text-page {
    padding: 20px;
    max-width: var(--small-width);
    margin: 0 auto;
}

.image-text-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .image-text-container {
        grid-template-columns: 1fr;
    }
}

.image-text-config {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.image-text-config::-webkit-scrollbar {
    width: 6px;
}

.image-text-config::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.image-text-config::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--image-text-pink);
    background: #fdf2f8;
}

.upload-area.dragover {
    border-color: var(--image-text-pink);
    background: var(--image-text-light);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #64748b;
}

.upload-tip {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.upload-preview {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 6px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.text-settings {
    animation: fadeIn 0.2s ease;
}

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

.config-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.config-row .config-section {
    flex: 1;
    margin-bottom: 0;
}

.config-section {
    margin-bottom: 16px;
}

.config-section label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.config-section input[type="text"],
.config-section input[type="number"],
.config-section select,
.config-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
    box-sizing: border-box;
}

.config-section input[type="text"]:focus,
.config-section input[type="number"]:focus,
.config-section select:focus,
.config-section textarea:focus {
    outline: none;
    border-color: var(--image-text-pink);
    background: white;
}

.config-section textarea {
    resize: vertical;
    min-height: 80px;
}

.config-section input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
}

.config-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--image-text-pink);
    border-radius: 50%;
    cursor: pointer;
}

.config-section input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--image-text-pink);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.color-value {
    font-size: 14px;
    color: #334155;
    font-family: monospace;
}

.range-value {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.position-btn {
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.position-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.position-btn.active {
    background: var(--image-text-light);
    border-color: var(--image-text-pink);
    color: var(--image-text-pink);
    font-weight: 600;
}

.btn-delete-text {
    width: 100%;
    padding: 10px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.btn-delete-text:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    padding: 10px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-primary {
    flex: 2;
    padding: 10px;
    background: linear-gradient(135deg, var(--image-text-pink) 0%, var(--image-text-dark) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.image-text-preview {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.preview-box {
    width: 100%;
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

#previewCanvas {
    max-width: 100%;
    max-height: 600px;
    object-fit: contain;
    display: none;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.preview-placeholder p {
    margin: 0;
    font-size: 14px;
}

.download-buttons {
    display: flex;
    gap: 10px;
}

.btn-download {
    flex: 1;
    padding: 10px;
    background: var(--image-text-light);
    color: var(--image-text-pink);
    border: 1px solid var(--image-text-pink);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover:not(:disabled) {
    background: var(--image-text-pink);
    color: white;
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}