/* ================================================
   MEDIGUATE - CUSTOM STYLES
   ================================================ */

/* CSS Variables */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #48bb78;
    --secondary-dark: #38a169;
    --accent: #f56565;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-600: #718096;
    --gray-900: #1a202c;
    --white: #ffffff;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.header-auth-btn {
    width: 190px;
    min-height: 50px;
    white-space: nowrap;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-verified {
    background: var(--secondary);
    color: var(--white);
}

.badge-license {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.badge-status-active {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.badge-status-inactive {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Rating */
.rating {
    color: #fbbf24;
    font-size: 1.125rem;
}

/* Hero Gradient */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,128C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

/* Section Titles */
.section-title {
    font-size: clamp(1.875rem, 5vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--gray-900);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 3rem;
    text-align: center;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

/* Doctor Card */
.doctor-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

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

.doctor-image {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

/* Featured cards: keep a controlled header height and bias framing upward (face first). */
.featured-doctor-photo {
    height: clamp(11rem, 23vw, 12rem);
    object-fit: contain;
    object-position: center center;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
}

.featured-doctor-photo--contain {
    object-fit: contain;
    object-position: center center;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
}

.doctor-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.doctor-specialty {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.price-online {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.875rem;
}

.price-presencial {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Specialty Card */
.specialty-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.specialty-card:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Stats */
.stats-item {
    padding: 1rem;
}

/* Trust Badge */
.trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.trust-icon {
    font-size: 1.5rem;
}

/* Search Input */
.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Featured Doctors Slider */
.featured-doctors-slider {
    position: relative;
}

.featured-doctors-track {
    --doctor-gap: 1.5rem;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--doctor-gap);
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
    user-select: none;
    cursor: grab;
    padding: 0 0.5rem 0.5rem 0.5rem;
    padding-right: min(18vw, 220px);
    overscroll-behavior-x: contain;
}

.featured-doctors-track::-webkit-scrollbar {
    display: none;
}

.featured-doctors-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.featured-doctors-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.featured-doctors-track .carousel-item {
    flex: 0 0 82%;
    min-width: 260px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (min-width: 640px) {
    .featured-doctors-track .carousel-item {
        flex-basis: 46%;
        min-width: 300px;
    }
}

@media (min-width: 1024px) {
    .featured-doctors-track .carousel-item {
        flex-basis: 34%;
        min-width: 320px;
    }
}

/* Testimonial Card */
.testimonial-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    object-fit: cover;
}

/* Footer */
.footer-column h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-link {
    display: block;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--primary);
}

.social-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all 0.2s;
    text-decoration: none;
}

.social-icon:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--gray-600);
    border-radius: 5px;
}

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

/* Scrollbar Hide (for carousel) */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* Focus Styles */
button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .section-title {
        font-size: 1.875rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
