/* Custom CSS for GenSpark Design Survey */

/* Custom font family */
.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Smooth transitions for all elements */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark mode styles */
body.dark {
    background-color: #0f172a;
    color: #e2e8f0;
}

body.dark header {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark .bg-white {
    background-color: #1e293b !important;
}

body.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

body.dark .text-gray-600 {
    color: #94a3b8 !important;
}

body.dark .text-gray-300 {
    color: #cbd5e1 !important;
}

body.dark .shadow-sm,
body.dark .shadow-lg {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Question animations */
.question-enter {
    opacity: 0;
    transform: translateX(30px);
}

.question-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-in-out;
}

.question-exit {
    opacity: 1;
    transform: translateX(0);
}

.question-exit-active {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s ease-in-out;
}

/* Custom radio button styles */
.custom-radio {
    position: relative;
    display: block;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.custom-radio:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-radio input[type="radio"]:checked + label {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.custom-radio input[type="radio"]:checked ~ .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.custom-radio input[type="radio"]:checked ~ .checkmark::after {
    display: block;
}

.checkmark {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

/* Image selection styles */
.image-option {
    position: relative;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    border: 3px solid transparent;
}

.image-option:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.image-option.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.image-option img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.2s ease-in-out;
}

.image-option.selected img {
    filter: brightness(1.1);
}

.image-option::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    opacity: 0;
    transition: all 0.2s ease-in-out;
}

.image-option.selected::after {
    opacity: 1;
}

.image-option::before {
    content: "✓";
    position: absolute;
    top: 16px;
    right: 16px;
    color: white;
    font-weight: bold;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s ease-in-out;
    z-index: 1;
}

.image-option.selected::before {
    opacity: 1;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Result card animations */
.result-card {
    animation: fadeInUp 0.6s ease-out;
}

.result-card:nth-child(2) {
    animation-delay: 0.2s;
}

.result-card:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar animation */
#progressBar {
    transition: width 0.5s ease-in-out;
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    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;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .custom-radio {
        padding: 0.75rem;
    }
    
    .image-option img {
        height: 150px;
    }
    
    #questionContainer {
        padding: 1.5rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .custom-radio {
        border-width: 3px;
    }
    
    .image-option {
        border-width: 4px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}