/* ==========================================================================
   Template: MediCare Plus
   Version: 1.0.0
   Author: Outline Templates
   Description: Premium Medical/Healthcare Clinic Template
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Theme Variables)
   -------------------------------------------------------------------------- */
:root {
    /* Medical Color Palette */
    --color-primary: #0EA5E9;
    --color-secondary: #06B6D4;
    --color-teal: #14B8A6;
    --color-accent: #10B981;
    --color-blue-light: #7DD3FC;
    --color-blue-dark: #0369A1;

    /* Neutral Colors */
    --color-text: #0F172A;
    --color-text-muted: #64748B;
    --color-background: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-border: #E2E8F0;
    --color-gray-50: #F8FAFC;
    --color-gray-100: #F1F5F9;
    --color-gray-200: #E2E8F0;

    /* Emergency/Alert Colors */
    --color-emergency: #EF4444;
    --color-emergency-dark: #DC2626;
    --color-warning: #F59E0B;
    --color-success: #10B981;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --shadow-medical: 0 20px 60px rgba(14, 165, 233, 0.15);
    --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent body scroll when mobile nav is open */
body.nav-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 1rem;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Backdrop blur for nav */
.nav-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* --------------------------------------------------------------------------
   Focus States (Accessibility)
   -------------------------------------------------------------------------- */

/* Visible focus for keyboard users only */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Enhanced focus for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Touch Targets (Mobile Accessibility)
   -------------------------------------------------------------------------- */

/* Minimum 44x44px touch targets */
button,
a,
input[type="checkbox"],
input[type="radio"],
select {
    min-height: 44px;
    min-width: 44px;
}

/* Inline links exception */
p a,
li a,
span a {
    min-height: auto;
    min-width: auto;
}

/* --------------------------------------------------------------------------
   Animation Classes
   -------------------------------------------------------------------------- */

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-bounce);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s var(--transition-bounce);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s var(--transition-bounce);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s var(--transition-bounce);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

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

/* --------------------------------------------------------------------------
   Reduced Motion Support
   -------------------------------------------------------------------------- */
@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;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input.error {
    border-color: var(--color-emergency);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.error-message {
    display: block;
    font-size: 0.875rem;
    color: var(--color-emergency);
    margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Button Components
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    text-align: center;
    font-family: var(--font-sans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.4);
}

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

.btn-secondary {
    background: white;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    background: rgba(14, 165, 233, 0.05);
}

/* --------------------------------------------------------------------------
   Card Components
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Service Cards */
.service-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s ease;
}

.service-card:hover {
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.15);
    transform: translateY(-8px);
    border-color: var(--color-primary);
}

/* Doctor Cards */
.doctor-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.doctor-card:hover {
    box-shadow: 0 20px 50px rgba(14, 165, 233, 0.12);
    transform: translateY(-5px);
}

/* Testimonial Cards */
.testimonial-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Blog Cards */
.blog-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.blog-card:hover {
    box-shadow: 0 15px 40px rgba(14, 165, 233, 0.12);
    transform: translateY(-5px);
}

/* --------------------------------------------------------------------------
   Icon Wrapper
   -------------------------------------------------------------------------- */
.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.service-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* --------------------------------------------------------------------------
   Insurance Badge
   -------------------------------------------------------------------------- */
.insurance-badge {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.insurance-badge:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(6, 182, 212, 0.15));
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Emergency Banner
   -------------------------------------------------------------------------- */
.emergency-banner {
    background: linear-gradient(135deg, var(--color-emergency) 0%, var(--color-emergency-dark) 100%);
}

/* --------------------------------------------------------------------------
   Badge Component
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--color-blue-dark);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
nav {
    transition: all var(--transition-base);
}

nav.scrolled {
    box-shadow: var(--shadow-md);
}

/* Mobile Navigation - Slide-in Panel */
[data-nav-menu] {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

[data-nav-menu].active {
    transform: translateX(0);
}

/* Mobile Nav Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1024px) {
    [data-nav-menu] {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background: transparent;
        transform: none;
        box-shadow: none;
        overflow: visible;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-blue-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-blue-light) var(--color-gray-100);
}

/* --------------------------------------------------------------------------
   Gradient Backgrounds
   -------------------------------------------------------------------------- */
.gradient-bg {
    background: radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 40%),
                radial-gradient(ellipse at 20% 80%, rgba(20, 184, 166, 0.06) 0%, transparent 40%);
}

.hero-glow {
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.2) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   Medical-Specific Glow Effects
   -------------------------------------------------------------------------- */
.medical-glow {
    box-shadow: 0 0 40px rgba(14, 165, 233, 0.3), 0 0 80px rgba(6, 182, 212, 0.2);
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.4),
                    0 0 40px rgba(6, 182, 212, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(14, 165, 233, 0.6),
                    0 0 60px rgba(6, 182, 212, 0.3);
    }
}

/* --------------------------------------------------------------------------
   Floating Animations
   -------------------------------------------------------------------------- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.float-1 { animation: float 4s ease-in-out infinite; }
.float-2 { animation: float-delayed 5s ease-in-out infinite 0.5s; }
.float-3 { animation: float 6s ease-in-out infinite 1s; }
.float-4 { animation: float-delayed 4.5s ease-in-out infinite 1.5s; }
.float-5 { animation: float 5.5s ease-in-out infinite 2s; }

/* --------------------------------------------------------------------------
   Orbit Animations
   -------------------------------------------------------------------------- */
@keyframes orbit {
    0% { transform: rotate(0deg) translateX(140px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(140px) rotate(-360deg); }
}

@keyframes orbit-reverse {
    0% { transform: rotate(360deg) translateX(180px) rotate(-360deg); }
    100% { transform: rotate(0deg) translateX(180px) rotate(0deg); }
}

.orbit-icon {
    position: absolute;
    animation: orbit 25s linear infinite;
}

.orbit-icon-reverse {
    position: absolute;
    animation: orbit-reverse 30s linear infinite;
}

/* --------------------------------------------------------------------------
   Heartbeat Animation
   -------------------------------------------------------------------------- */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Responsive Utilities
   -------------------------------------------------------------------------- */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    /* Hide navigation, footer, and interactive elements */
    nav,
    footer,
    .emergency-banner,
    button,
    [data-nav-toggle],
    .skip-link {
        display: none !important;
    }

    /* Optimize for printing */
    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    /* Show URLs for links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* --------------------------------------------------------------------------
   Accessibility - High Contrast Mode Support
   -------------------------------------------------------------------------- */
@media (prefers-contrast: high) {
    :root {
        --color-border: #000000;
        --color-text-muted: #000000;
    }

    .btn-primary {
        border: 2px solid #000000;
    }

    .btn-secondary {
        border: 2px solid #000000;
    }
}

/* --------------------------------------------------------------------------
   Dark Mode Support (Optional)
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
    /* This is optional for medical templates */
}
