/* ==========================================
   SPOTIFY PLACA - Optimized CSS (Zero Lag)
   ========================================== */

/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
    font-size: 16px !important;
}

/* ==========================================
   GPU Acceleration for Fixed Elements
   Prevents disappearing on mobile scroll
   ========================================== */
header {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Touch targets */
button, a {
    min-height: 44px;
}

/* ==========================================
   Upload Area
   ========================================== */
.upload-area {
    border: 2px dashed rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.02);
}

.upload-area.dragover {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.08);
}

.upload-area.has-image {
    border-style: solid;
    border-color: #1DB954;
    background: rgba(29, 185, 84, 0.05);
}

/* Photo compact state */
#photo-compact {
    cursor: pointer;
}

#photo-section.compact {
    padding: 12px 16px;
}

/* ==========================================
   Search Results
   ========================================== */
#search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(29, 185, 84, 0.3) transparent;
}

#search-results::-webkit-scrollbar {
    width: 6px;
}

#search-results::-webkit-scrollbar-thumb {
    background: rgba(29, 185, 84, 0.3);
    border-radius: 3px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: rgba(29, 185, 84, 0.1);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-item .song-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .song-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .song-artist {
    color: #71717a;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .song-duration {
    color: #52525b;
    font-size: 12px;
    flex-shrink: 0;
    font-family: monospace;
}

.search-empty {
    padding: 32px 16px;
    text-align: center;
    color: #71717a;
}

.search-empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #52525b;
}

/* ==========================================
   Time Slider
   ========================================== */
input[type="range"]#time-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

input[type="range"]#time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}

input[type="range"]#time-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}

.time-preset.active {
    background: rgba(29, 185, 84, 0.2) !important;
    border-color: #1DB954 !important;
    color: #1DB954 !important;
}

/* ==========================================
   Form Inputs
   ========================================== */
.form-input {
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-input:focus {
    outline: none;
    border-color: #1DB954;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* ==========================================
   Buttons
   ========================================== */
.btn-primary {
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
    color: white;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #3f3f46;
}

/* ==========================================
   Loading Spinner
   ========================================== */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f43f5e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   Toast Notifications
   ========================================== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 24px;
    border-radius: 16px;
    z-index: 1000;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(29, 185, 84, 0.4);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================
   Mobile - Preview Section
   ========================================== */
.preview-section {
    padding-bottom: 20px;
}

/* ==========================================
   Mobile - Bottom CTA
   ========================================== */
.bottom-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: #0a0a0f;
    z-index: 50;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* GPU Acceleration - Prevents disappearing on mobile scroll */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@media (min-width: 1024px) {
    .bottom-cta {
        display: none;
    }
}

/* ==========================================
   Preview Container
   ========================================== */
.preview-container {
    position: relative;
    font-family: 'DM Sans', sans-serif;
}

/* ==========================================
   Demo Section Styles
   ========================================== */
#experimente .preview-container {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.5));
}

#demo-preview-photo-placeholder {
    transition: all 0.2s ease;
}

#demo-preview-photo-placeholder:hover {
    background: rgba(200, 200, 200, 0.95) !important;
}

#demo-preview-photo-placeholder:hover svg {
    color: #f43f5e;
}

/* Demo upload area hover */
#demo-upload-area {
    transition: all 0.3s ease;
}

#demo-upload-area:hover {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.05);
}

#demo-upload-area.has-image {
    border-style: solid;
    border-color: rgba(29, 185, 84, 0.5);
    background: rgba(29, 185, 84, 0.05);
}

#demo-upload-area.has-image:hover {
    border-color: rgba(29, 185, 84, 0.7);
    background: rgba(29, 185, 84, 0.08);
}

/* Demo search results */
#demo-search-results {
    scrollbar-width: thin;
    scrollbar-color: rgba(29, 185, 84, 0.3) transparent;
}

#demo-search-results::-webkit-scrollbar {
    width: 6px;
}

#demo-search-results::-webkit-scrollbar-thumb {
    background: rgba(29, 185, 84, 0.3);
    border-radius: 3px;
}

#demo-search-results .search-result-item:hover {
    background: rgba(29, 185, 84, 0.1);
}

/* Demo CTA animation */
#demo-complete-cta {
    animation: demo-cta-pulse 2s ease-in-out infinite;
}

@keyframes demo-cta-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(244, 63, 94, 0.2);
    }
}

/* Demo crop modal */
#demo-crop-modal {
    touch-action: none;
}

#demo-crop-image {
    max-width: none;
    max-height: none;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

#demo-crop-container {
    touch-action: none;
}

#demo-crop-zoom {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

#demo-crop-zoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}

#demo-crop-zoom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}

/* Demo toast positioning */
.demo-toast {
    bottom: 120px;
}

@media (min-width: 1024px) {
    .demo-toast {
        bottom: 40px;
    }
}

/* ==========================================
   FAQ Accordion
   ========================================== */
.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* ==========================================
   Crop Modal
   ========================================== */
#crop-modal {
    touch-action: none;
}

#crop-image {
    max-width: none;
    max-height: none;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

#crop-container {
    touch-action: none;
}

#crop-zoom {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

#crop-zoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}

#crop-zoom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    border: 3px solid white;
}
