/* Not-Real Hospital - Custom Styles */

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

/* Tells the browser to render native form controls (select dropdowns,
   checkboxes, date pickers, etc.) with dark-appropriate colors -- without
   this, a <select>'s own popup list stays light-themed (dark text on a
   light native background) even though the closed control looks dark,
   since Tailwind utility classes only style the closed-state box, not
   the browser's native popup rendering. */
html.dark {
    color-scheme: dark;
}

/* Custom selection color */
::selection {
    background: rgba(124, 58, 237, 0.2);
    color: #1E1B4B;
}

.dark ::selection {
    background: rgba(124, 58, 237, 0.35);
    color: #F5F3FF;
}

/* Focus styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #7C3AED;
    outline-offset: 2px;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigation link hover effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(to right, #7C3AED, #EC4899);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Doctor card hover effect */
.doctor-card {
    transition: all 0.3s ease;
}

/* Gradient text animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

/* Pulse animation for logo */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Button hover glow effect */
.btn-glow:hover {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

/* Card shine effect on hover */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.card-shine:hover::before {
    transform: rotate(45deg) translateX(100%);
}

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

.specialty-card:hover {
    transform: translateY(-8px);
}

/* Time slot button states */
.time-slot {
    transition: all 0.2s ease;
}

.time-slot:hover:not(:disabled) {
    transform: scale(1.05);
}

.time-slot.selected {
    background: linear-gradient(to right, #7C3AED, #EC4899);
    color: white;
    border-color: transparent;
}

/* Booked slot - greyed out */
.time-slot.booked-slot {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
}

.time-slot.booked-slot:hover {
    transform: none;
    background-color: #f3f4f6;
    color: #9ca3af;
    border-color: #d1d5db;
}

/* Modal backdrop blur */
.modal-backdrop {
    backdrop-filter: blur(8px);
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

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

.dark ::-webkit-scrollbar-track {
    background: #0f172a; /* slate-900, matches the dark theme's page background */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #7C3AED, #EC4899);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #6D28D9, #DB2777);
}

/* Page transition */
.page-transition {
    animation: fadeIn 0.3s ease;
}

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

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Staggered animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Image error fallback styling */
img[onerror] {
    object-fit: cover;
}

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

    body {
        background: white !important;
    }

    .doctor-card {
        break-inside: avoid;
    }
}

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