/* Custom CSS for Prof. Rishard Website
   Premium, elegant, and accessible design
   Complements Tailwind CSS via CDN */

/* CSS Custom Properties */
:root {
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-rose: #e11d48;
    --color-rose-light: #ffe4e6;
    --color-sage: #42a855;
    --color-sage-light: #ccebd2;
    --font-serif: 'Lora', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Base Styles */
body {
    font-family: var(--font-sans);
    color: #1f2937;
    background-color: #ffffff;
    overflow-x: hidden;
}


/* Glassmorphism Navigation */
html {
    scroll-behavior: smooth;
}

#main-nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#main-nav.bg-white\/95 {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Service Card Hover Effects */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Reveal Animation Base */
.reveal {
    /* Start visible by default - GSAP will handle the animation if loaded */
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Button Hover Effects */
a[href^="#"], button[type="submit"] {
    transition: all 0.3s ease;
}

a[href^="#"]:hover, button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Form Input Focus Styles */
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* Error States */
.error-message {
    color: #e11d48;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

input.error, textarea.error, select.error {
    border-color: #e11d48;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.2);
}

/* Toast Notifications */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s;
    max-width: 400px;
}

.toast-success {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.toast-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Prose Styles for Article Content */
.prose h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
}

.prose h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.75;
}

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: var(--color-primary);
    text-decoration: underline;
}

.prose a:hover {
    color: var(--color-primary-dark);
}

.prose blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.5rem 0;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease;
}

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

/* Admin Sidebar Active State */
.sidebar-link.active {
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
    border-radius: 0.5rem;
    font-weight: 500;
}

/* Status Badges */
.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-completed {
    background-color: #f3f4f6;
    color: #374151;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility: Focus Visible */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip to main content link (accessibility) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* Print Styles */
@media print {
    #main-nav, #mobile-menu, footer, .toast-container {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .prose a {
        text-decoration: none;
        color: #000;
    }

    .prose a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.875rem;
        color: #666;
    }
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid currentColor;
    }

    input, textarea, select {
        border: 2px solid currentColor;
    }
}

/* ============================================
   Appointment Wizard Styles
   ============================================ */

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.wizard-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
}

.wizard-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #f9fafb;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.wizard-step-dot.active {
    border-color: #0d9488;
    background: #0d9488;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.2);
}

.wizard-step-dot.completed {
    border-color: #0d9488;
    background: #0d9488;
    color: #ffffff;
}

.wizard-step-dot.completed::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
}

.wizard-step-dot.completed .step-number {
    display: none;
}

.wizard-step-line {
    width: 60px;
    height: 2px;
    background: #d1d5db;
    transition: background 0.4s ease;
    flex-shrink: 0;
}

.wizard-step-line.active {
    background: #0d9488;
}

.wizard-step-label {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    max-width: 70px;
    margin-left: auto;
    margin-right: auto;
    transition: color 0.3s ease;
}

.wizard-step-dot.active + .wizard-step-label,
.wizard-step-dot.completed + .wizard-step-label {
    color: #0d9488;
    font-weight: 500;
}

.wizard-step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wizard-panel {
    display: none;
    animation: wizardFadeIn 0.4s ease forwards;
}

.wizard-panel.active {
    display: block;
}

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

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.wizard-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.wizard-btn-prev {
    background: #f3f4f6;
    color: #374151;
}

.wizard-btn-prev:hover {
    background: #e5e7eb;
}

.wizard-btn-next {
    background: #0d9488;
    color: #ffffff;
    margin-left: auto;
}

.wizard-btn-next:hover {
    background: #0f766e;
}

.wizard-btn-next:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.wizard-btn-submit {
    background: #0d9488;
    color: #ffffff;
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-btn-submit:hover {
    background: #0f766e;
}

.time-range-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.time-range-card:hover {
    border-color: #0d9488;
    background: #f0fdfa;
}

.time-range-card.time-range-full {
    opacity: 0.7;
    cursor: pointer;
    background: #f9fafb;
    border-color: #fecaca;
}

.time-range-card.time-range-full:hover {
    border-color: #e11d48;
    background: #fef2f2;
    opacity: 1;
}

.time-range-time {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    margin-bottom: 0.25rem;
}

.time-range-time i {
    color: #0d9488;
}

.time-range-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.time-range-capacity {
    color: #6b7280;
}

.time-range-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.time-range-badge-ok {
    background: #d1fae5;
    color: #065f46;
}

.time-range-badge-low {
    background: #fef3c7;
    color: #92400e;
}

.time-range-badge-full {
    background: #fee2e2;
    color: #991b1b;
}

.time-range-notes {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.375rem;
}

/* ============================================
   Slot Grid (within expanded time range)
   ============================================ */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.375rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 56px;
    justify-content: center;
}

.slot-btn .slot-number {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1;
}

.slot-btn .slot-label {
    font-size: 0.65rem;
    margin-top: 0.125rem;
    line-height: 1;
}

.slot-btn.slot-selectable {
    border-color: #0d9488;
    background: #f0fdfa;
    color: #0d9488;
}

.slot-btn.slot-selectable:hover {
    background: #0d9488;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.slot-btn.slot-selectable .slot-label {
    color: #0f766e;
}

.slot-btn.slot-selectable:hover .slot-label {
    color: #ccfbf1;
}

.slot-btn.slot-selected {
    border-color: #0d9488;
    background: #0d9488;
    color: #ffffff;
}

.slot-btn.slot-selected .slot-label {
    color: #ccfbf1;
}

.slot-btn.slot-booked {
    border-color: #f3f4f6;
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.slot-btn.slot-booked .slot-number {
    color: #9ca3af;
}

.slot-btn.slot-booked .slot-label {
    color: #d1d5db;
}

.slot-btn.slot-unavailable {
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.5;
}

.slot-btn.slot-unavailable .slot-label {
    color: #d1d5db;
}

.slot-btn:disabled {
    cursor: not-allowed;
}

.slot-grid-error {
    text-align: center;
    padding: 1rem;
    color: #e11d48;
    background: #fef2f2;
    border-radius: 0.5rem;
    font-size: 0.85rem;
}

.slot-grid-notes {
    font-size: 0.75rem;
    color: #9ca3af;
}

.slot-grid-full-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 0.75rem;
}

.slot-grid-full-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.slot-grid-full-icon i {
    font-size: 1.5rem;
    color: #e11d48;
}

.slot-grid-full-title {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 0.375rem;
}

.slot-grid-full-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
    max-width: 280px;
}

.slot-grid-full-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
}

.slot-grid-full-inline-text {
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 500;
}

.slot-grid-request-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #7c3aed;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-grid-request-btn:hover {
    background: #6d28d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.slot-grid-request-btn-inline {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: #7c3aed;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.75rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-grid-request-btn-inline:hover {
    background: #6d28d9;
}

/* ============================================
   Locked Slot Display
   ============================================ */

#locked-slot-container {
    animation: wizardFadeIn 0.3s ease;
}

#lock-countdown {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Time Slot Grid (legacy)
   ============================================ */

@media (max-width: 640px) {
    .wizard-step-dot {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    .wizard-step-line {
        width: 30px;
    }
    .wizard-step-label {
        font-size: 0.6rem;
        max-width: 50px;
    }
    .time-slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .slot-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

/* ============================================
   Hospital Selection Cards
   ============================================ */

.hospital-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.hospital-card {
    position: relative;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #ffffff;
    transition: all 0.25s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.hospital-card:hover {
    border-color: #0d9488;
    background: #f0fdfa;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
}

.hospital-card.selected {
    border-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa, #f0fdfa);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.hospital-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: #f0fdfa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.hospital-card.selected .hospital-card-icon {
    background: #0d9488;
}

.hospital-card-icon i {
    font-size: 1rem;
    color: #0d9488;
    transition: color 0.25s ease;
}

.hospital-card.selected .hospital-card-icon i {
    color: #ffffff;
}

.hospital-card-content {
    flex: 1;
    min-width: 0;
}

.hospital-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.hospital-card.selected .hospital-card-name {
    color: #0d9488;
}

.hospital-card-address {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.hospital-card.selected .hospital-card-address {
    color: #0f766e;
}

.hospital-card-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0d9488;
    display: none;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.625rem;
}

.hospital-card.selected .hospital-card-check {
    display: flex;
}

.hospital-card-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

@media (max-width: 640px) {
    .hospital-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Schedule Section (Frontend Homepage)
   ============================================ */

.schedule-hospital-card {
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.3s ease;
}

.schedule-hospital-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.schedule-hospital-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 2rem 1.25rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
}

.schedule-hospital-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: #0d9488;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.schedule-hospital-icon i {
    font-size: 1.25rem;
    color: #ffffff;
}

.schedule-hospital-info {
    flex: 1;
    min-width: 0;
}

.schedule-hospital-name {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.375rem;
}

.schedule-hospital-address {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 1rem;
}

.schedule-hospital-address i {
    color: #0d9488;
    font-size: 0.75rem;
}

.schedule-hospital-phone {
    color: #0d9488;
    font-weight: 500;
}

.schedule-hospital-body {
    padding: 1.25rem 2rem 1.5rem;
}

.schedule-day-group {
    margin-bottom: 1rem;
}

.schedule-day-group:last-child {
    margin-bottom: 0;
}

.schedule-day-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0d9488;
    margin-bottom: 0.5rem;
}

.schedule-day-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.schedule-slot-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 9999px;
    font-size: 0.85rem;
    color: #115e59;
    transition: all 0.2s ease;
}

.schedule-slot-pill:hover {
    background: #ccfbf1;
    border-color: #99f6e4;
}

.schedule-slot-time {
    font-weight: 500;
    white-space: nowrap;
}

.schedule-slot-time i {
    color: #0d9488;
    margin-right: 0.375rem;
}

.schedule-slot-note {
    font-size: 0.75rem;
    color: #94a3b8;
    border-left: 1px solid #ccfbf1;
    padding-left: 0.75rem;
    font-style: italic;
}

@media (max-width: 640px) {
    .schedule-hospital-header {
        padding: 1rem 1.25rem 1rem;
        flex-direction: column;
    }

    .schedule-hospital-body {
        padding: 1rem 1.25rem 1.25rem;
    }

    .schedule-hospital-address {
        flex-direction: column;
        gap: 0.25rem;
    }

    .schedule-slot-pill {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        border-radius: 0.5rem;
    }

    .schedule-slot-note {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #ccfbf1;
        padding-top: 0.25rem;
    }
}

/* ============================================
   Appointment Wizard Slot Labels (Date Picker)
   ============================================ */

.schedule-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.25rem 0;
}

.schedule-date-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.schedule-date-label i {
    color: #0d9488;
}

/* ============================================
    Available Days Pills (Appointment Wizard)
    ============================================ */

.available-day-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d9488;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 3rem;
}
#extra-request-modal {
    animation: confirmFadeIn 0.2s ease;
}

@media (max-width: 640px) {
    #extra-request-modal > div:last-child {
        padding: 1rem;
    }
}
