/**
 * Creative Scroll to Top Button - Admin Styles
 * Version: 1.2.0
 */

/* Style Grid */
.creative-scroll-to-top-button-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 10px;
    max-width: 100%;
}

/* Style Options */
.creative-scroll-to-top-button-style-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    position: relative;
}

.creative-scroll-to-top-button-style-option:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.creative-scroll-to-top-button-style-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.creative-scroll-to-top-button-style-option input[type="radio"] {
    margin-bottom: 10px;
    transform: scale(1.2);
}

/* Style Previews */
.creative-scroll-to-top-button-style-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    position: relative;
    transition: all 0.3s ease;
}

/* Preview Styles - Matching Frontend */
.creative-scroll-to-top-button-preview-classic {
    background: linear-gradient(135deg, #8b5cf6, #f59e0b);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.creative-scroll-to-top-button-preview-progress {
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}

.creative-scroll-to-top-button-preview-rocket {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    animation: admin-rocket-float 2s ease-in-out infinite;
}

@keyframes admin-rocket-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.creative-scroll-to-top-button-preview-bubble {
    background: rgba(139, 92, 246, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.3);
    animation: admin-bubble-float 3s ease-in-out infinite;
}

@keyframes admin-bubble-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.creative-scroll-to-top-button-preview-minimal {
    background: rgba(139, 92, 246, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    animation: admin-minimal-glow 2s ease-in-out infinite;
}

@keyframes admin-minimal-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 25px rgba(139, 92, 246, 0.6); }
}

.creative-scroll-to-top-button-preview-cosmic {
    background: linear-gradient(135deg, #8b5cf6, #f59e0b);
    animation: admin-cosmic-pulse 2s ease-in-out infinite;
}

@keyframes admin-cosmic-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.6); }
}

.creative-scroll-to-top-button-preview-holographic {
    background: linear-gradient(45deg, #06b6d4, #8b5cf6, #ec4899);
    animation: admin-holographic-shift 3s ease-in-out infinite;
}

@keyframes admin-holographic-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    33% { filter: hue-rotate(120deg); }
    66% { filter: hue-rotate(240deg); }
}

.creative-scroll-to-top-button-preview-neon {
    background: #0f172a;
    border: 2px solid #06b6d4;
    color: #06b6d4;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5), inset 0 0 15px rgba(6, 182, 212, 0.1);
    animation: admin-neon-pulse 2s ease-in-out infinite;
}

@keyframes admin-neon-pulse {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.5), inset 0 0 15px rgba(6, 182, 212, 0.1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.8), inset 0 0 25px rgba(6, 182, 212, 0.2);
    }
}

.creative-scroll-to-top-button-preview-magic {
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b);
    animation: admin-magic-sparkle 3s ease-in-out infinite;
}

.creative-scroll-to-top-button-preview-magic {
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b);
    animation: admin-magic-sparkle 3s ease-in-out infinite;
}

@keyframes admin-magic-sparkle {
    0%, 100% { transform: rotate(0deg); filter: brightness(1); }
    25% { transform: rotate(2deg); filter: brightness(1.2); }
    50% { transform: rotate(-1deg); filter: brightness(1.1); }
    75% { transform: rotate(1deg); filter: brightness(1.15); }
}

.creative-scroll-to-top-button-preview-liquid {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    animation: admin-liquid-flow 2s ease-in-out infinite;
}

@keyframes admin-liquid-flow {
    0%, 100% { border-radius: 50%; }
    25% { border-radius: 60% 40% 60% 40%; }
    50% { border-radius: 40% 60% 40% 60%; }
    75% { border-radius: 60% 40% 60% 40%; }
}

.creative-scroll-to-top-button-preview-origami {
    background: linear-gradient(135deg, #f7f1e8, #e8dcc6);
    color: #8b4513;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    overflow: hidden;
}

.creative-scroll-to-top-button-preview-origami::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: admin-origami-fold 3s linear infinite;
}

@keyframes admin-origami-fold {
    0% { left: -100%; }
    100% { left: 100%; }
}

.creative-scroll-to-top-button-preview-quantum {
    background: radial-gradient(circle, #1e1b4b, #312e81);
    border: 2px solid #8b5cf6;
    color: #8b5cf6;
    position: relative;
}

.creative-scroll-to-top-button-preview-quantum::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #8b5cf6;
    border-radius: 50%;
    box-shadow: 
        0 0 0 15px rgba(139, 92, 246, 0.1),
        0 0 0 30px rgba(139, 92, 246, 0.05);
    animation: admin-quantum-pulse 2s ease-in-out infinite;
}

@keyframes admin-quantum-pulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.5); }
}

.creative-scroll-to-top-button-preview-morphing {
    background: linear-gradient(45deg, #ec4899, #8b5cf6);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.creative-scroll-to-top-button-style-option:hover .creative-scroll-to-top-button-preview-morphing {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    transform: rotate(45deg);
    background: linear-gradient(45deg, #8b5cf6, #3b82f6);
}

.creative-scroll-to-top-button-preview-flame {
    background: radial-gradient(circle at center, #f97316, #dc2626);
    color: #fef3c7;
    position: relative;
}

.creative-scroll-to-top-button-preview-flame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.3), transparent 70%);
    border-radius: 50%;
    animation: admin-flame-flicker 1.5s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes admin-flame-flicker {
    0% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    100% { transform: scale(1.1) rotate(2deg); opacity: 1; }
}

.creative-scroll-to-top-button-preview-crystal {
    background: linear-gradient(135deg, 
        #ef4444, 
        #f59e0b, 
        #10b981, 
        #06b6d4, 
        #8b5cf6, 
        #ec4899);
    background-size: 400% 400%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    animation: admin-crystal-rainbow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.creative-scroll-to-top-button-preview-crystal::before {
    content: '';
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.6) 50%, transparent 70%);
    animation: admin-crystal-refraction 2s linear infinite;
}

@keyframes admin-crystal-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes admin-crystal-refraction {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.creative-scroll-to-top-button-preview-back-to-top {
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 25px;
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
}

.creative-scroll-to-top-button-style-option:hover .creative-scroll-to-top-button-preview-back-to-top {
    background: #e74c3c;
    color: white;
}

/* Color Picker Styles */
.creative-scroll-to-top-button-color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

/* Range Slider */
.creative-scroll-to-top-button-range-value {
    font-weight: bold;
    margin-left: 10px;
    color: #0073aa;
}

input[type="range"] {
    width: 300px;
    margin-right: 10px;
}

/* Post Types Grid */
.creative-scroll-to-top-button-post-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.creative-scroll-to-top-button-post-types-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.creative-scroll-to-top-button-post-types-grid label:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.creative-scroll-to-top-button-post-types-grid input[type="checkbox"]:checked + span {
    color: #0073aa;
    font-weight: 500;
}

/* Form Styling */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.form-table td {
    padding: 15px 10px 20px 0;
    vertical-align: top;
}

.form-table .description {
    color: #666;
    font-style: italic;
    margin-top: 5px;
    font-size: 13px;
}

/* ── Live Preview ── */
.creative-scroll-to-top-button-preview-box {
}

.creative-scroll-to-top-button-live-preview-area {
    background: #f0f4f8;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0;
    border-radius: 8px;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin-bottom: 10px;
    overflow: hidden;
}

#creative-scroll-to-top-button-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Inherit CSS custom properties set by JS for colour preview */
}

/* Override browser-default button styles inside the preview */
#creative-scroll-to-top-button-preview-container .creative-scroll-to-top-button-btn {
    cursor: default;
}

/* Size modifiers — frontend CSS scopes these to #creative-scroll-to-top-button-container,
   so we re-declare them here scoped to the preview container instead. */
#creative-scroll-to-top-button-preview-container[data-size="small"] .creative-scroll-to-top-button-btn,
#creative-scroll-to-top-button-preview-container[data-size="small"] .creative-scroll-to-top-button-progress {
    width: 2.5rem !important;
    height: 2.5rem !important;
}
#creative-scroll-to-top-button-preview-container[data-size="large"] .creative-scroll-to-top-button-btn,
#creative-scroll-to-top-button-preview-container[data-size="large"] .creative-scroll-to-top-button-progress {
    width: 4.5rem !important;
    height: 4.5rem !important;
}

/* ── Icon Picker ── */
.creative-scroll-to-top-button-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.creative-scroll-to-top-button-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 6px 6px;
    border: 2px solid #e2e2e2;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    width: 74px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.creative-scroll-to-top-button-icon-option:hover {
    border-color: #8b5cf6;
    background: #f9f7ff;
}

.creative-scroll-to-top-button-icon-option.selected {
    border-color: #8b5cf6;
    background: #f3f0ff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.creative-scroll-to-top-button-icon-preview-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    flex-shrink: 0;
}

.creative-scroll-to-top-button-icon-preview-circle svg {
    display: block;
}

.creative-scroll-to-top-button-icon-label {
    font-size: 11px;
    font-weight: 600;
    color: #444;
    line-height: 1.3;
}

.creative-scroll-to-top-button-icon-note {
    font-size: 10px;
    color: #999;
    line-height: 1.2;
}

/* Responsive Design */
@media (max-width: 782px) {
    .creative-scroll-to-top-button-style-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .creative-scroll-to-top-button-post-types-grid {
        grid-template-columns: 1fr;
    }
    
    input[type="range"] {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .creative-scroll-to-top-button-style-grid {
        grid-template-columns: 1fr;
    }
    
    .creative-scroll-to-top-button-style-option {
        padding: 10px;
    }
    
    .creative-scroll-to-top-button-style-preview {
        width: 40px;
        height: 40px;
    }
}

/* Field validation error */
.creative-scroll-to-top-button-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638 !important;
}

.creative-scroll-to-top-button-field-error-msg {
    color: #d63638;
    font-style: normal !important;
    margin-top: 6px !important;
    font-size: 13px;
}

/* Success Message */
.notice.settings-error {
    margin: 15px 0 20px 0;
}

/* Accessibility */
.creative-scroll-to-top-button-style-option:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

input[type="color"]:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}


/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .creative-scroll-to-top-button-style-preview,
    .creative-scroll-to-top-button-preview-demo {
        animation: none !important;
    }
}