:root {
    --styler-bg: #0a0a0f;
    --styler-card-bg: #141419;
    --styler-card-hover: #1a1a22;
    --styler-accent: #6366f1;
    --styler-accent-secondary: #a855f7;
    --styler-accent-glow: rgba(99, 102, 241, 0.25);
    --styler-text: #f4f4f5;
    --styler-text-muted: #71717a;
    --styler-border: rgba(255, 255, 255, 0.06);
    --styler-error: #ef4444;
}

body {
    background: var(--styler-bg);
}

.styler-page {
    min-height: calc(100vh - 80px);
    background: var(--styler-bg);
    margin: -1.5rem;
    margin-top: -1rem;
    padding: 3rem 2rem;
}

.styler-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.styler-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--styler-accent);
    margin-bottom: 0.75rem;
}

.styler-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--styler-text);
    margin: 0 0 0.75rem;
    letter-spacing: -0.025em;
}

.styler-subtitle {
    font-size: 1rem;
    color: var(--styler-text-muted);
    margin: 0;
}

.styler-gallery-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.6rem 1.25rem;
    background: var(--styler-card-bg);
    border: 1px solid var(--styler-border);
    border-radius: 8px;
    color: var(--styler-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.styler-gallery-link:hover {
    background: var(--styler-card-hover);
    color: var(--styler-text);
    border-color: var(--styler-accent);
}

.styler-gallery-link svg {
    width: 16px;
    height: 16px;
}

.styler-error-banner {
    max-width: 700px;
    margin: 0 auto 2rem;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: none;
}

.styler-error-banner.visible {
    display: block;
}

.styler-error-text {
    color: var(--styler-error);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.styler-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.styler-upload-card {
    background: var(--styler-card-bg);
    border: 1px solid var(--styler-border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.25s ease;
    position: relative;
}

.styler-upload-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, var(--styler-accent) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.styler-upload-card:hover::before {
    opacity: 1;
}

.styler-upload-card-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.styler-upload-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--styler-text);
    margin: 0 0 0.25rem;
}

.styler-upload-card-desc {
    font-size: 0.8rem;
    color: var(--styler-text-muted);
    margin: 0;
}

.styler-upload-card-desc strong {
    color: var(--styler-accent);
    font-weight: 600;
}

.styler-dropzone {
    position: relative;
    border: 2px dashed var(--styler-border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.2);
}

.styler-dropzone:hover {
    border-color: var(--styler-accent);
    background: rgba(99, 102, 241, 0.05);
}

.styler-dropzone-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    color: var(--styler-text-muted);
    opacity: 0.6;
}

.styler-dropzone-text {
    font-size: 0.85rem;
    color: var(--styler-text-muted);
    margin: 0;
}

.styler-dropzone-text span {
    color: var(--styler-accent);
    font-weight: 500;
}

.styler-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.styler-preview {
    margin-top: 1rem;
    border-radius: 10px;
    overflow: hidden;
    display: none;
    background: rgba(0, 0, 0, 0.2);
    height: 180px;
}

.styler-preview.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.styler-preview img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    display: block;
}

.styler-action-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 4rem;
}

.styler-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--styler-accent), var(--styler-accent-secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    opacity: 0.4;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.styler-submit-btn.active {
    opacity: 1;
    pointer-events: auto;
}

.styler-submit-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.styler-submit-btn svg {
    width: 18px;
    height: 18px;
}

.styler-submit-btn.loading {
    pointer-events: none;
}

.styler-submit-btn .styler-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: styler-spin 0.7s linear infinite;
    display: none;
}

.styler-submit-btn.loading .styler-spinner {
    display: block;
}

.styler-submit-btn.loading .styler-submit-icon {
    display: none;
}

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

.styler-weight-control {
    width: 100%;
    max-width: 200px;
    margin-bottom: 1.5rem;
}

.styler-weight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.styler-weight-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--styler-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.styler-weight-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--styler-accent);
    min-width: 40px;
    text-align: right;
}

.styler-weight-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.styler-weight-hint {
    font-size: 0.7rem;
    color: var(--styler-text-muted);
    white-space: nowrap;
}

.styler-weight-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--styler-card-bg);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.styler-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--styler-accent), var(--styler-accent-secondary));
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.styler-weight-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.styler-weight-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--styler-accent), var(--styler-accent-secondary));
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.styler-weight-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.styler-weight-slider::-moz-range-track {
    height: 6px;
    background: var(--styler-card-bg);
    border-radius: 3px;
}

.styler-arrow {
    display: flex;
    align-items: center;
    color: var(--styler-text-muted);
    opacity: 0.3;
    margin: 1.5rem 0;
}

.styler-arrow svg {
    width: 24px;
    height: 24px;
}

.styler-header-links {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.styler-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--styler-card-bg);
    border: 1px solid var(--styler-border);
    border-radius: 8px;
    color: var(--styler-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.25rem;
}

.styler-info-btn:hover {
    background: var(--styler-card-hover);
    color: var(--styler-text);
    border-color: var(--styler-accent);
}

.styler-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

.styler-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.styler-popup {
    background: var(--styler-card-bg);
    border-radius: 20px;
    border: 1px solid var(--styler-border);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.96) translateY(16px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.styler-popup-overlay.active .styler-popup {
    transform: scale(1) translateY(0);
}

.styler-popup-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--styler-border);
    background: var(--styler-bg);
    color: var(--styler-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.styler-popup-close:hover {
    background: var(--styler-card-hover);
    color: var(--styler-text);
    border-color: var(--styler-accent);
}

.styler-popup-header {
    padding: 2rem 2rem 0;
    text-align: center;
}

.styler-popup-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--styler-accent);
    margin-bottom: 0.5rem;
}

.styler-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--styler-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.styler-popup-body {
    padding: 2rem;
}

.styler-popup-section {
    margin-bottom: 1.75rem;
}

.styler-popup-section:last-child {
    margin-bottom: 0;
}

.styler-popup-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--styler-text);
    margin: 0 0 0.75rem;
}

.styler-popup-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--styler-text-muted);
    margin: 0 0 0.75rem;
}

.styler-popup-section p:last-child {
    margin-bottom: 0;
}

.styler-popup-list {
    margin: 1rem 0;
    padding-left: 1.25rem;
    list-style: none;
}

.styler-popup-list li {
    position: relative;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--styler-text-muted);
    margin-bottom: 0.75rem;
    padding-left: 1rem;
}

.styler-popup-list li::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--styler-accent);
}

.styler-popup-list li strong {
    color: var(--styler-text);
    font-weight: 600;
}

.styler-popup-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 2rem 2rem 0;
    padding: 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
}

.styler-popup-warning svg {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
}

.styler-popup-warning p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #fbbf24;
    margin: 0;
}

@media (max-width: 900px) {
    .styler-form {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 400px;
    }

    .styler-action-column {
        padding-top: 0;
        order: 3;
    }

    .styler-weight-control {
        max-width: 100%;
    }

    .styler-arrow {
        display: none;
    }

    .styler-page {
        padding: 2rem 1rem;
    }

    .styler-popup {
        margin: 1rem;
        max-height: 90vh;
    }

    .styler-popup-header {
        padding: 1.5rem 1.5rem 0;
    }

    .styler-popup-body {
        padding: 1.5rem;
    }

    .styler-popup-warning {
        margin: 1.5rem 1.5rem 0;
    }
}
