/* ==========================================================================
   QuickSlide CSS - Modern Dark Theme & Glassmorphism
   ========================================================================== */

/* Font & Color Variables */
:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(22, 24, 37, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-1: #00f2fe; /* Neon Cyan */
    --accent-2: #7b2cbf; /* Neon Violet */
    --accent-grad: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    --danger: #ef4444;
    --success: #10b981;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Strict 9:16 aspect ratio variables for slider & preview */
    --slider-width: 270px;
    --slider-height: 480px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 16px;
    background-image: 
        radial-gradient(at 10% 20%, rgba(123, 44, 191, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(0, 242, 254, 0.12) 0px, transparent 50%);
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile frame size on desktop */
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header Styles */
.app-header {
    text-align: center;
    margin-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon {
    font-size: 1.8rem;
    animation: pulse 2s infinite ease-in-out;
}

.accent-text {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 300;
}

/* Screen States */
.app-screen {
    display: none;
}

.app-screen.active {
    display: block;
    animation: fadeIn 0.4s ease-out forwards;
}

/* Card Styles */
.card {
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.card.glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: -8px;
}

/* File Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.upload-box {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    aspect-ratio: 3/4;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.upload-box:hover {
    border-color: var(--accent-1);
    background: rgba(0, 242, 254, 0.02);
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: var(--accent-2);
    background: rgba(123, 44, 191, 0.05);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    pointer-events: none;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.upload-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-subtext {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Preview Containers inside Upload Boxes */
.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: none;
    background: #000;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 4;
    transition: var(--transition);
}

.btn-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

/* Style Section & Transition Options */
.style-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
}

.transition-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.transition-option input[type="radio"] {
    display: none;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.option-icon {
    font-size: 1.5rem;
}

.option-title {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
}

.transition-option input[type="radio"]:checked + .option-card {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--accent-1);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

.transition-option input[type="radio"]:checked + .option-card .option-title {
    color: var(--text-primary);
    font-weight: 600;
}

.transition-option input[type="radio"]:checked + .option-card .option-icon {
    transform: scale(1.1);
}

/* Comparison Slider CSS */
.comparison-slider-container {
    position: relative;
    width: var(--slider-width);
    height: var(--slider-height);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: #000;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

.before-layer, .after-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.before-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.after-layer {
    z-index: 2;
    width: 50%; /* JS will change this dynamically */
    overflow: hidden;
}

/* Ensure the image inside after-layer matches full container size to prevent squeezing */
.after-layer img {
    width: var(--slider-width);
    height: var(--slider-height);
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    pointer-events: none;
    max-width: none; /* Prevents container boundary squishing */
}

.slider-handle {
    position: absolute;
    top: 0;
    left: 50%; /* JS will change this */
    width: 4px;
    height: 100%;
    background: #fff;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.slider-handle-line {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-handle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    color: var(--bg-color);
    font-size: 10px;
    font-weight: bold;
    border: none;
    pointer-events: none;
}

/* Vertical Slider Adjustments */
.comparison-slider-container.vertical .after-layer {
    width: 100%;
    height: 50%;
}

.comparison-slider-container.vertical .slider-handle {
    width: 100%;
    height: 4px;
    left: 0;
    top: 50%;
    cursor: ns-resize;
    transform: translateY(-50%);
}

.comparison-slider-container.vertical .slider-handle-button {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Settings and Input Styles */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.styled-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.styled-select:focus {
    border-color: var(--accent-1);
    background: rgba(0, 242, 254, 0.02);
}

/* Button Styles */
.btn-primary {
    background: var(--accent-grad);
    border: none;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.2);
    width: 100%;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 242, 254, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

/* Progress Bar CSS */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-grad);
    border-radius: 4px;
    transition: width 0.1s ease-out;
}

.progress-percent {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-1);
}

/* Success Checkmark & Animation */
.completed-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: scaleUp 0.4s ease-out forwards;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--success);
    position: relative;
    animation: pulseCheck 1.5s infinite alternate;
}

.checkmark-stem, .checkmark-kick {
    position: absolute;
    background-color: var(--success);
    border-radius: 2px;
}

.checkmark-stem {
    width: 4px;
    height: 30px;
    left: 42px;
    top: 18px;
    transform: rotate(45deg);
}

.checkmark-kick {
    width: 18px;
    height: 4px;
    left: 28px;
    top: 40px;
    transform: rotate(45deg);
}

.success-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Video Preview Wrapper */
.video-preview-wrapper {
    width: calc(var(--slider-width) * 0.9); /* Slightly smaller than slider to fit nicely */
    height: calc(var(--slider-height) * 0.9);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--card-border);
    margin: 10px auto;
    background: #000;
}

.video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes pulseCheck {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    100% { transform: scale(1.03); box-shadow: 0 0 15px 4px rgba(16, 185, 129, 0.2); }
}

/* Pro Section / Premium Styles */
.pro-section {
    background: rgba(255, 215, 0, 0.01);
    border: 1px solid rgba(255, 215, 0, 0.12);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 4px;
    transition: var(--transition);
}

.pro-section.pro-active {
    background: rgba(255, 215, 0, 0.04);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.pro-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.pro-badge {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    align-self: flex-start;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.pro-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.pro-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pro-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.btn-pro-buy {
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%) !important;
    color: #000 !important;
    font-family: var(--font-heading);
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
}

.btn-pro-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4) !important;
}

.license-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.styled-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.styled-input:focus {
    border-color: var(--accent-1);
    background: rgba(0, 242, 254, 0.02);
}

.license-input-group .btn-secondary {
    width: auto;
    font-size: 0.85rem;
    padding: 10px 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.status-msg {
    font-size: 0.75rem;
    margin-top: 8px;
    display: none;
}

.status-msg.error {
    color: var(--danger);
    display: block;
}

.status-msg.success {
    color: var(--success);
    display: block;
}

.status-msg.info {
    color: var(--accent-1);
    display: block;
}

/* Pro Unlocked State Styling */
.pro-success-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pro-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-icon {
    font-size: 1.4rem;
    animation: bounce 2s infinite ease-in-out;
}

.pro-desc-success {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    font-weight: 500;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

