/* ===== MODERN SCREENSHOTTER UI ===== */
/* Fixed -webkit-appearance and added proper vendor prefixes */

/* URL Input Styling */
.url-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.url-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.url-input:hover {
    border-color: #cbd5e1;
    background: white;
}

.url-input:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.2);
}

.url-scan-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.url-scan-btn:hover {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

/* Quick URL Buttons */
.quick-url-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.quick-url-btn:hover {
    background: white;
    border-color: #6366f1;
    color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Format Selector */
.format-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.format-option {
    cursor: pointer;
}

.format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.format-card.active {
    border-color: #6366f1;
    background: #eef2ff;
    transform: scale(1.02);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.3);
}

.format-card i {
    font-size: 24px;
    margin-bottom: 4px;
}

.format-card span:last-child {
    color: #64748b;
}

/* Viewport Presets */
.viewport-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.preset-btn i {
    font-size: 20px;
    margin-bottom: 2px;
}

.preset-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -8px rgba(99, 102, 241, 0.3);
}

.preset-btn:hover:not(.active) {
    border-color: #94a3b8;
    background: white;
}

/* Size Sliders - Fixed appearance properties */
.size-slider {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #6366f1, #818cf8);
    border-radius: 3px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

/* Chrome/Safari slider thumb */
.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #6366f1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    margin-top: -7px;
}

.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Firefox slider thumb */
.size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #6366f1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    -moz-appearance: none;
    appearance: none;
}

.size-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Firefox track */
.size-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #6366f1, #818cf8);
    border-radius: 3px;
    border: none;
}

/* DPR Selector */
.dpr-selector {
    display: flex;
    gap: 8px;
}

.dpr-btn {
    flex: 1;
    padding: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.dpr-btn.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #6366f1;
    box-shadow: inset 0 2px 4px rgba(99, 102, 241, 0.1);
}

/* Toggle Checkbox */
.toggle-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
}

.toggle-checkbox:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.toggle-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Delay Input */
.delay-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 14px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.delay-input:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Remove spinner buttons from number inputs - cross-browser solution */
.delay-input::-webkit-inner-spin-button,
.delay-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}


.delay-input {
    appearance: textfield; /* -moz-appearance Firefox - still needed for older versions */
}

/* Modern Firefox uses this */
@-moz-document url-prefix() {
    .delay-input {
        appearance: none;
        -moz-appearance: textfield;
    }
}

/* Alternative approach using a wrapper for better compatibility */
.delay-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.delay-input-wrapper .delay-input {
    padding-right: 40px;
}

.delay-input-wrapper .spin-buttons {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 24px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
}

.delay-input-wrapper .spin-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 10px;
    transition: all 0.2s ease;
}

.delay-input-wrapper .spin-btn:hover {
    background: #eef2ff;
    color: #6366f1;
}

.delay-input-wrapper .spin-btn:first-child {
    border-bottom: 1px solid #e2e8f0;
}

/* Capture Button */
.capture-btn {
    position: relative;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.capture-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px -5px rgba(99, 102, 241, 0.5);
}

.capture-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px -5px rgba(99, 102, 241, 0.4);
}

.btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.capture-btn:hover .btn-shine {
    left: 100%;
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.download-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    border: 2px solid white;
}

/* Reset Button */
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.reset-btn:hover {
    background: white;
    border-color: #94a3b8;
    color: #1e293b;
}

/* Preview Container */
.preview-container {
    position: relative;
    background: #1e293b;
    min-height: 500px;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
}

.preview-result {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

/* Empty State */
.empty-preview {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #94a3b8;
    animation: float 3s ease-in-out infinite;
}

.empty-preview h4 {
    font-size: 20px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.empty-preview p {
    color: #64748b;
    max-width: 300px;
    margin: 0 auto;
}

.empty-example {
    margin-top: 40px;
    opacity: 0.3;
}

.example-device {
    width: 200px;
    height: 140px;
    margin: 0 auto;
    background: #cbd5e1;
    border-radius: 12px;
    padding: 8px;
}

.example-screen {
    width: 100%;
    height: 100%;
    background: #94a3b8;
    border-radius: 6px;
    animation: pulse 2s ease-in-out infinite;
}

/* Preview Info Overlay */
.preview-info {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.info-chip {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    border-top-color: #8b5cf6;
    animation-duration: 1.5s;
}

.spinner-ring:nth-child(3) {
    border-top-color: #ec4899;
    animation-duration: 2s;
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 16px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    transition: width 0.3s ease;
}

/* Preview Toolbar */
.preview-toolbar-btn {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.preview-toolbar-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Preview Badge */
.preview-badge {
    padding: 4px 10px;
    background: #eef2ff;
    color: #6366f1;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.preview-badge.ready {
    background: #e6f7e6;
    color: #10b981;
}

/* Keyboard Shortcuts */
.shortcuts-hint {
    position: relative;
    width: 48px;
    height: 48px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.shortcuts-hint:hover {
    border-color: #6366f1;
    color: #6366f1;
    transform: scale(1.1);
}

.shortcuts-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    pointer-events: none;
    border: 1px solid #e2e8f0;
}

.shortcuts-hint:hover .shortcuts-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
    color: #334155;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Responsive */
@media (max-width: 1024px) {
    .viewport-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .format-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .format-selector {
        grid-template-columns: 1fr;
    }
    
    .format-card {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }
    
    .empty-preview {
        padding: 32px 16px;
    }
    
    .preview-info {
        flex-wrap: wrap;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .preview-container {
        background: #0f172a;
    }
    
    .empty-preview h4 {
        color: #e2e8f0;
    }
    
    .empty-preview p {
        color: #94a3b8;
    }
}

/* Print styles */
@media print {
    .capture-btn,
    .download-btn,
    .reset-btn,
    .shortcuts-hint {
        display: none;
    }
}