/**
 * Passport Size Photo Generator - Custom Styles
 * Additional styles for the photo generator interface
 */

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Upload zone hover effects */
#upload-zone {
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

#upload-zone:hover {
    background-color: rgba(28, 53, 94, 0.02);
}

#upload-zone.dragging {
    background-color: rgba(28, 53, 94, 0.05);
    border-color: #7C213B;
}

/* Canvas styling */
canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Range slider customization */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    opacity: 0.9;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1C355E;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #7C213B;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1C355E;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #7C213B;
    transform: scale(1.1);
}

/* Format tab active state */
.format-tab {
    transition: all 0.2s ease;
}

.format-tab:hover:not(.bg-white) {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Notification animation */
#notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Progress bar animation */
#progress-fill {
    transition: width 0.5s ease;
}

/* Canvas container responsive sizing */
@media (max-width: 768px) {
    #preview-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .container {
        padding: 0 1rem;
    }
}

/* Print-specific styles */
@media print {
    header, footer, #notification {
        display: none !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    canvas {
        page-break-inside: avoid;
    }
}

/* Face detection overlay styles */
.face-box {
    border: 2px solid #16A34A;
    box-shadow: 0 0 10px rgba(22, 163, 74, 0.3);
}

/* Smooth fade-in for results */
#results-section {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button hover effects */
button {
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::after {
    width: 300px;
    height: 300px;
}

/* Card shadow effects */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.shadow-lg:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading overlay backdrop blur */
#loading-overlay {
    backdrop-filter: blur(4px);
}

/* Tooltip styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 0.5rem;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
}

/* Accessibility improvements */
button:focus, 
input:focus,
select:focus {
    outline: 2px solid #1C355E;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }
    
    .border-dashed {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}

/* Mobile-specific optimizations */
@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .grid-cols-1 {
        gap: 1rem;
    }
    
    button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .lg\:col-span-1 {
        grid-column: span 1;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print optimization for passport photos */
@page {
    size: A4;
    margin: 1cm;
}

@media print {
    body {
        background: white;
    }
    
    canvas {
        max-width: 100%;
        page-break-inside: avoid;
    }
}