/* CDC Sample App - Custom Styles */

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

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

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

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Apply animations to elements */
.role-card {
    animation: fadeInUp 0.6s ease-out;
}

.role-card:nth-child(2) {
    animation-delay: 0.1s;
}

/* Hover effects */
.role-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Button hover effects */
button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Download button states */
.download-btn {
    position: relative;
    overflow: hidden;
}

.download-btn::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;
}

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

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

/* Quiz question animations */
.quiz-question {
    animation: slideInRight 0.5s ease-out;
}

.quiz-question:nth-child(2) {
    animation-delay: 0.1s;
}

.quiz-question:nth-child(3) {
    animation-delay: 0.2s;
}

/* AI response typing effect */
.ai-typing {
    overflow: hidden;
    border-right: 2px solid #1e40af;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #1e40af;
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {

    /* Adjust spacing for mobile */
    .container {
        padding: 0 1rem;
    }

    /* Stack grid items vertically on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Adjust button sizes for touch */
    button {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    /* Make modals more mobile-friendly */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    /* Adjust card spacing */
    .card {
        margin-bottom: 1rem;
    }

    /* Optimize touch targets */
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve mobile navigation */
    .nav-item {
        padding: 0.75rem 1rem;
    }

    /* Mobile-optimized forms */
    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    /* Mobile-friendly tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile card layouts */
    .mobile-card {
        border-radius: 0.75rem;
        margin: 0.5rem 0;
    }

    /* Mobile progress indicators */
    .mobile-progress {
        height: 8px;
        border-radius: 4px;
    }

    /* Mobile-friendly modals */
    .mobile-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 1000;
        overflow-y: auto;
    }
}

/* Tablet-specific styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large screen enhancements */
@media (min-width: 1025px) {
    .container {
        padding: 0 4rem;
    }

    /* Add hover effects for desktop */
    .desktop-hover:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    }

    /* Enhanced animations for desktop */
    .enhanced-animation {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff !important;
        border: 2px solid #000000 !important;
    }

    .text-gray-600 {
        color: #000000 !important;
    }

    .border-gray-200 {
        border-color: #000000 !important;
        border-width: 2px !important;
    }
}

/* Focus states for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* 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%;
    }
}

/* Success and error states */
.success {
    background-color: #10b981 !important;
    color: white !important;
}

.error {
    background-color: #ef4444 !important;
    color: white !important;
}

.warning {
    background-color: #f59e0b !important;
    color: white !important;
}

/* Custom tooltips */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }

    .dark-mode .bg-white {
        background-color: #374151;
    }

    .dark-mode .text-gray-800 {
        color: #f9fafb;
    }

    .dark-mode .text-gray-600 {
        color: #d1d5db;
    }
}

/* Custom focus ring for better accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.5);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
    background-color: rgba(30, 64, 175, 0.2);
    color: #1e40af;
}

/* Enhanced button states */
.btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(30, 64, 175, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-alt {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #1e40af;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Responsive typography */
.text-responsive {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.heading-responsive {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Custom checkbox and radio styles */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: #1e40af;
    border-color: #1e40af;
}

.custom-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

.custom-radio {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.custom-radio:checked {
    border-color: #1e40af;
}

.custom-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    background: #1e40af;
    border-radius: 50%;
}