/**
 * Premium Watermark Tool Styling
 */
.watermark-builder {
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .watermark-builder {
    background: var(--gray-800);
    border-color: rgba(255, 255, 255, 0.05);
}

.wm-config-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .wm-config-grid {
        grid-template-columns: 1fr;
    }
}

/* Controls */
.wm-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wm-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

[data-theme="dark"] .wm-label {
    color: var(--gray-200);
}

.wm-label i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.wm-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-family: inherit;
    background: var(--gray-50);
    transition: all 0.3s;
}

[data-theme="dark"] .wm-input {
    background: var(--gray-900);
    border-color: var(--gray-700);
    color: #fff;
}

.wm-input:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

/* Type Chips */
.wm-type-chips {
    display: flex;
    gap: 12px;
}

.wm-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
    background: var(--gray-50);
}

[data-theme="dark"] .wm-chip {
    background: var(--gray-900);
    border-color: var(--gray-700);
    color: var(--gray-400);
}

.wm-chip.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .wm-chip.active {
    background: rgba(67, 97, 238, 0.15);
}

/* Color Picker */
.wm-color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gray-50);
    padding: 8px 14px;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
}

[data-theme="dark"] .wm-color-picker-wrapper {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

.wm-color-input {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

#wmColorValue {
    font-weight: 700;
    font-family: monospace;
    color: var(--gray-600);
}

/* Position Grid */
.wm-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wm-pos-btn {
    aspect-ratio: 1;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

[data-theme="dark"] .wm-pos-btn {
    background: var(--gray-900);
}

.wm-pos-btn::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gray-400);
    border-radius: 20%;
}

.wm-pos-btn[data-pos="tl"]::after {
    top: 6px;
    left: 6px;
}

.wm-pos-btn[data-pos="tr"]::after {
    top: 6px;
    right: 6px;
}

.wm-pos-btn[data-pos="center"]::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
}

.wm-pos-btn[data-pos="bl"]::after {
    bottom: 6px;
    left: 6px;
}

.wm-pos-btn[data-pos="br"]::after {
    bottom: 6px;
    right: 6px;
}

.wm-pos-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

[data-theme="dark"] .wm-pos-btn.active {
    background: rgba(67, 97, 238, 0.15);
}

.wm-pos-btn.full {
    grid-column: span 3;
    aspect-ratio: auto;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

.wm-pos-btn.full i {
    width: 16px;
    height: 16px;
}

/* Sliders */
.wm-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wm-label-row span {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.wm-slider {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
    appearance: none;
}

.wm-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(67, 97, 238, 0.3);
    transition: transform 0.2s;
}

.wm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Preview */
.wm-preview-container {
    background: var(--gray-50);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

[data-theme="dark"] .wm-preview-container {
    background: var(--gray-900);
}

.wm-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wm-preview-head span {
    font-weight: 700;
    color: var(--gray-600);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-reset-btn {
    background: none;
    border: none;
    color: #e63946;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wm-canvas-wrapper {
    flex: 1;
    min-height: 400px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px dashed var(--gray-300);
}

[data-theme="dark"] .wm-canvas-wrapper {
    background: #111;
    border-color: var(--gray-700);
}

#wmCanvas {
    max-width: 100%;
    max-height: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.wm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--gray-400);
    text-align: center;
}

.wm-placeholder i {
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

/* File Drop */
.wm-file-drop {
    border: 2px dashed var(--gray-300);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.wm-file-drop:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.wm-file-drop p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-500);
}

.wm-file-name {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: 8px;
    text-align: center;
}

/* Main Upload */
.wm-main-upload-area {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: center;
}

.wm-main-upload-btn {
    background: linear-gradient(135deg, var(--primary), #4cc9f0);
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.2);
    transition: all 0.3s;
}

/* Actions */
.wm-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--gray-100);
    padding-top: 24px;
}

[data-theme="dark"] .wm-actions {
    border-color: var(--gray-700);
}

.wm-execute-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.wm-execute-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
}

.wm-execute-btn i {
    width: 20px;
    height: 20px;
}