/* Import Tailwind and globals */
@import url('./globals.css');

/* Custom animations to replace Motion/React */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }

    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }

    90% {
        transform: translate3d(0,-4px,0);
    }
}

@keyframes wobble {
    0% {
        transform: translate3d(0, 0, 0);
    }

    15% {
        transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }

    30% {
        transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
    }

    45% {
        transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
    }

    60% {
        transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
    }

    75% {
        transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
    }

    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.5s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.5s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-pulse-slow {
    animation: pulse 2s ease-in-out infinite;
}

.animate-rotate-slow {
    animation: rotate 2s ease-in-out infinite;
    animation-delay: 3s;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-wobble {
    animation: wobble 1s infinite;
}

.animate-progress {
    animation: progressFill 0.8s ease-out forwards;
}

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-scale:active {
    transform: scale(0.95);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover-arrow:hover .arrow-icon {
    transform: translateX(5px);
    transition: transform 0.2s ease;
}

.hover-rotate:hover {
    transform: rotate(15deg);
    transition: transform 0.2s ease;
}

/* Card transitions */
.card-transition {
    transition: all 0.3s ease;
}

.card-transition:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Quiz specific styles */
.quiz-card {
    transition: all 0.5s ease;
}

.quiz-option {
    transition: all 0.3s ease;
}

.quiz-option:hover .option-card {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.quiz-option:hover .option-icon {
    transform: scale(1.1);
}

.quiz-option .arrow-icon {
    transition: all 0.2s ease;
    opacity: 0.5;
}

.quiz-option:hover .arrow-icon {
    transform: translateX(5px);
    opacity: 1;
}

.option-card {
    transition: all 0.3s ease;
}

.option-icon {
    transition: all 0.3s ease;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.8s ease-out;
}

/* Quiz type buttons */
.quiz-type-btn {
    transition: all 0.2s ease;
}

.quiz-type-btn:hover {
    transform: scale(1.05);
}

/* Results animations */
.results-container {
    animation: scaleIn 0.6s ease-out forwards;
}

.results-icon {
    animation: pulse 2s ease-in-out infinite;
    animation-delay: 1s;
}

/* Newsletter animation */
.newsletter-success {
    animation: scaleIn 0.3s ease-out forwards;
}

/* Social icon hover */
.social-icon {
    transition: all 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.2);
}

/* Button animations */
.next-btn, .previous-btn, .restart-btn, .view-gifts-btn {
    transition: all 0.2s ease;
}

.next-btn:hover, .previous-btn:hover, .restart-btn:hover, .view-gifts-btn:hover {
    transform: scale(1.05);
}

.next-btn:active, .previous-btn:active, .restart-btn:active, .view-gifts-btn:active {
    transform: scale(0.95);
}

/* Disabled button states */
.next-btn:disabled, .previous-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* Hidden by default for animations */
.animate-on-load {
    opacity: 0;
}

/* Form focus styles */
.form-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #059669;
}

.notification.info {
    background-color: #2563eb;
}

.notification.error {
    background-color: #dc2626;
}

/* Keyboard navigation styles */
.using-keyboard button:focus,
.using-keyboard .quiz-option:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Quiz selector styles */
.quiz-selector-option {
    transition: all 0.3s ease;
}

.quiz-selector-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quiz-card {
        margin: 0 1rem;
    }
    
    .option-card {
        padding: 1rem;
    }
    
    .option-card .flex {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .quiz-type-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .quiz-selector-option {
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    .quiz-type-btn span {
        display: none;
    }
    
    .back-to-selector {
        font-size: 0.75rem;
    }
    
    .results-container h2 {
        font-size: 1.5rem;
    }
    
    .results-container .text-4xl {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    .hover-scale, .hover-shadow, .hover-arrow, .hover-rotate {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .animate-on-load {
        opacity: 1 !important;
        animation: none !important;
    }
    
    .notification {
        display: none !important;
    }
}

/* Dark mode support (if needed) */
/*@media (prefers-color-scheme: dark) {
    .quiz-option:hover .option-card {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .notification {
        background-color: #374151;
        color: #f9fafb;
    }
}
*/
/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .option-card {
        border-width: 3px;
    }
    
    .quiz-type-btn {
        border-width: 2px;
    }
    
    .notification {
        border: 2px solid currentColor;
    }
}

/* Focus styles for better accessibility */
button:focus-visible,
.quiz-option:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Ensure text remains readable during font swaps */
@font-display swap {
    font-display: swap;
}

.p-4 {
    padding: 1rem !important;
}