/**
 * Weather Effect Premium - Demo Page Styles
 * Self-contained styles for the frontend demo page
 */

/* Container */
.wep-demo-container {
    display: flex !important;
    gap: 24px !important;
    max-width: 1400px !important;
    margin: 40px auto !important;
    padding: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    box-sizing: border-box !important;
    align-items: flex-start !important;
}

.wep-demo-container *,
.wep-demo-container *::before,
.wep-demo-container *::after {
    box-sizing: border-box;
}

/* Settings Panel */
.wep-demo-settings {
    flex: 0 0 400px;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 28px;
    color: #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wep-demo-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wep-demo-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wep-demo-subtitle {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

/* Sections */
.wep-demo-section {
    margin-bottom: 20px;
}

.wep-demo-section-advanced {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wep-demo-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Select */
.wep-demo-select {
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    padding: 14px 40px 14px 16px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    box-sizing: border-box !important;
}

.wep-demo-select:hover,
.wep-demo-select:focus {
    border-color: #60a5fa;
    outline: none;
    background-color: rgba(255, 255, 255, 0.08);
}

.wep-demo-select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px;
}

/* Image Toggle Grid */
.wep-demo-image-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wep-demo-image-card {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wep-demo-image-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wep-demo-image-card:hover {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.wep-demo-image-card.selected {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

.wep-demo-image-card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    border-radius: 50%;
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Sliders - iOS minimal style with progress fill */
.wep-demo-slider-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 0 !important;
}

.wep-demo-slider {
    flex: 1 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 3px !important;
    background: linear-gradient(to right, #3b82f6 0%, #3b82f6 var(--progress, 25%), #374151 var(--progress, 25%), #374151 100%) !important;
    border-radius: 2px !important;
    outline: none !important;
    cursor: pointer !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

.wep-demo-slider::-webkit-slider-runnable-track {
    height: 3px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.wep-demo-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.1s ease !important;
    margin-top: -7.5px !important;
}

.wep-demo-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1) !important;
}

.wep-demo-slider::-moz-range-thumb {
    width: 18px !important;
    height: 18px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.wep-demo-slider::-moz-range-track {
    height: 3px !important;
    background: #374151 !important;
    border: none !important;
    border-radius: 1px !important;
}

.wep-demo-slider::-moz-range-progress {
    background: #3b82f6 !important;
    height: 3px !important;
    border-radius: 1px !important;
}

.wep-demo-slider-value {
    min-width: 28px !important;
    padding: 2px 0 !important;
    background: transparent !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-align: right !important;
}

.wep-demo-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    text-align: center;
}

/* Toggle Group */
.wep-demo-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.wep-demo-toggle {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.wep-demo-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.wep-demo-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
}

.wep-demo-toggle-label input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.wep-demo-toggle-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    border-color: transparent;
}

.wep-demo-toggle-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.wep-demo-toggle-text {
    color: #cbd5e1;
}

/* Buttons */
.wep-demo-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.wep-demo-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.wep-demo-btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.wep-demo-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
}

.wep-demo-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.wep-demo-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.wep-demo-btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.wep-demo-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* CTA */
.wep-demo-cta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.wep-demo-cta p {
    margin: 0 0 12px 0;
    color: #94a3b8;
    font-size: 14px;
}

.wep-demo-cta .wep-demo-btn {
    width: 100%;
}

/* Preview Panel */
.wep-demo-preview {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    position: sticky !important;
    top: 100px !important;
    align-self: flex-start !important;
    max-height: calc(100vh - 120px) !important;
    width: 100% !important;
}

.wep-demo-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    color: #e2e8f0;
    font-weight: 600;
    flex-shrink: 0;
}

.wep-demo-preview-hint {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.wep-demo-preview-area {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
    /* 16:9 aspect ratio */
    background:
        radial-gradient(ellipse at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 119, 115, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 40%, rgba(72, 187, 255, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 40%, #16213e 70%, #0f0f23 100%) !important;
    border-radius: 0 0 16px 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: none !important;
    overflow: hidden !important;
    animation: aurora 15s ease-in-out infinite !important;
}

@keyframes aurora {

    0%,
    100% {
        background-position: 0% 50%, 100% 50%, 50% 50%, 0% 0%;
    }

    50% {
        background-position: 100% 50%, 0% 50%, 50% 100%, 0% 0%;
    }
}

/* Twinkling stars effect */
.wep-demo-preview-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 250px 160px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 300px 90px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 350px 200px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 400px 130px, rgba(255, 255, 255, 0.7), transparent);
    background-repeat: repeat;
    background-size: 450px 250px;
    animation: twinkle 4s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.wep-demo-preview-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 40px 60px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wep-demo-preview-text h3 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wep-demo-preview-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Demo Canvas - positioned inside preview area */
.wep-demo-preview-area canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .wep-demo-container {
        flex-direction: column;
        padding: 15px;
        margin: 20px auto;
    }

    .wep-demo-settings {
        flex: none;
        width: 100%;
    }

    .wep-demo-preview {
        min-height: 400px;
    }

    .wep-demo-toggle-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .wep-demo-header h2 {
        font-size: 20px;
    }

    .wep-demo-settings {
        padding: 20px;
    }

    .wep-demo-actions {
        flex-direction: column;
    }
}