/* ========================================
   MUYESU MEDICAL CENTRE
   Components Styles
   Reusable UI elements across all pages
   ======================================== */

/* ========================================
   1. BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

/* Primary - Green (Appointments, CTAs) */
.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(41, 151, 100, 0.30);
}

/* Secondary - Deep Blue (Info, navigation) */
.btn-secondary {
    background: var(--deep-blue);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--medical-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 59, 120, 0.25);
}

/* Outline */
.btn-outline {
    border-color: var(--deep-blue);
    color: var(--deep-blue);
    background: transparent;
}

.btn-outline:hover {
    background: var(--deep-blue);
    color: var(--white);
}

/* Emergency - Red */
.btn-emergency {
    background: var(--red);
    color: var(--white);
    animation: pulse-emergency 2s infinite;
}

.btn-emergency:hover {
    background: var(--red-dark);
    transform: scale(1.02);
}

@keyframes pulse-emergency {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(215, 47, 47, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(215, 47, 47, 0);
    }
}

/* WhatsApp */
.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}

.btn-whatsapp:hover {
    background: #1DA851;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.30);
}

/* White (on dark backgrounds) */
.btn-white {
    background: var(--white);
    color: var(--deep-blue);
}

.btn-white:hover {
    background: var(--off-white);
    transform: translateY(-2px);
}

/* Ghost (transparent with border) */
.btn-ghost {
    background: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Disabled */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Full width */
.btn-block {
    width: 100%;
    justify-content: center;
}

/* Button with icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Button Loading State (used by JS) */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   2. CARDS
   ======================================== */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.card-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.card-header h3 {
    margin-bottom: 0;
}

.card-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

/* Service Card (used in services page) */
.service-card {
    background: var(--white);
    padding: 30px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: #C8D8EF;
}

.service-card .icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--blue-light);
    color: var(--medical-blue);
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.service-card h3 {
    color: var(--deep-blue);
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.service-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-light);
}

.service-card .category-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--blue-light);
    color: var(--medical-blue);
    margin-top: 12px;
}

/* Category-specific tags */
.service-card.category-lab .category-tag {
    background: #E8F0FE;
    color: #1A56DB;
}

.service-card.category-family .category-tag {
    background: #FEF3C7;
    color: #B45309;
}

.service-card.category-emergency .category-tag {
    background: var(--red-light);
    color: var(--red);
}

.service-card.category-women .category-tag {
    background: #FCE4EC;
    color: #C62828;
}

.service-card.category-hiv .category-tag {
    background: #E8F0FE;
    color: #1A56DB;
}

.service-card.category-sti .category-tag {
    background: #FCE4EC;
    color: #C62828;
}

.service-card.category-curative .category-tag {
    background: #E8F0FE;
    color: #1A56DB;
}

/* Info Card (quick info) */
.info-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.info-card .icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--medical-blue);
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    font-size: 1.3rem;
}

.info-card h4 {
    color: var(--deep-blue);
    margin-bottom: 4px;
}

.info-card p {
    font-size: 0.88rem;
    margin-bottom: 0;
}

/* Feature Card */
.feature-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.feature-card:hover {
    background: var(--blue-light);
}

.feature-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--green-light);
    color: var(--green);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.feature-card h4 {
    color: var(--deep-blue);
    margin-bottom: 2px;
}

.feature-card p {
    font-size: 0.88rem;
    margin-bottom: 0;
}

/* ========================================
   3. BADGES
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--blue-light);
    color: var(--medical-blue);
}

.badge-green {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-red {
    background: var(--red-light);
    color: var(--red);
}

.badge-gold {
    background: #FEF3C7;
    color: #B45309;
}

.badge-white {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.badge-verified {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-verified::before {
    content: '✓';
    font-weight: 800;
    margin-right: 4px;
}

/* ========================================
   4. FORMS
   ======================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group .required {
    color: var(--red);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--medical-blue);
    box-shadow: 0 0 0 3px rgba(36, 85, 164, 0.10);
}

.form-control::placeholder {
    color: #B0B8C4;
}

.form-control.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(215, 47, 47, 0.10);
}

.form-control.success {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(41, 151, 100, 0.10);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Form Row (two columns) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* Form inline (horizontal) */
.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--medical-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

/* Form validation messages */
.form-error {
    color: var(--red);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-error.visible {
    display: block;
}

.form-success {
    display: none;
    padding: 16px 20px;
    background: var(--green-light);
    color: var(--green-dark);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--green);
    margin-top: 16px;
    position: relative;
}

.form-success.visible {
    display: block;
}

.form-success .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--green-dark);
    opacity: 0.6;
    transition: var(--transition);
}

.form-success .close-btn:hover {
    opacity: 1;
}

/* ========================================
   5. ALERTS
   ======================================== */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    margin-bottom: 16px;
}

.alert-info {
    background: var(--blue-light);
    border-color: var(--medical-blue);
    color: var(--deep-blue);
}

.alert-success {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
}

.alert-warning {
    background: #FEF3C7;
    border-color: #B45309;
    color: #B45309;
}

.alert-danger {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
}

.alert .alert-icon {
    margin-right: 10px;
}

/* ========================================
   6. MODALS
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.modal-header h3 {
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   7. BREADCRUMBS
   ======================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.88rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--medical-blue);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--deep-blue);
}

.breadcrumb .separator {
    color: var(--border);
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

/* ========================================
   8. PAGINATION
   ======================================== */

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--blue-light);
    border-color: var(--medical-blue);
    color: var(--medical-blue);
}

.pagination .active {
    background: var(--medical-blue);
    border-color: var(--medical-blue);
    color: var(--white);
}

.pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   9. TABS
   ======================================== */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 22px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover {
    color: var(--deep-blue);
}

.tab.active {
    color: var(--medical-blue);
    border-bottom-color: var(--medical-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   10. TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9999;
    width: min(380px, calc(100% - 40px));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
    background: var(--green-light);
    color: var(--green-dark);
    border-left-color: var(--green);
}

.toast-error {
    background: var(--red-light);
    color: var(--red);
    border-left-color: var(--red);
}

.toast-info {
    background: var(--blue-light);
    color: var(--deep-blue);
    border-left-color: var(--medical-blue);
}

.toast-hide {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   11. DIVIDER
   ======================================== */

.divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 30px 0;
}

.divider-light {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   12. TOOLTIP
   ======================================== */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.tooltip:hover .tooltip-text {
    opacity: 1;
}

/* ========================================
   13. DROPDOWN (Navigation)
   ======================================== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 200px;
    box-shadow: var(--shadow);
    border-radius: var(--radius-sm);
    padding: 8px 0;
    border: 1px solid var(--border);
}

.nav-dropdown.dropdown-open .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text);
    font-weight: 400;
    border-bottom: none !important;
}

.nav-dropdown .dropdown-menu a:hover {
    background: var(--blue-light);
    color: var(--medical-blue);
}

/* ========================================
   14. ANIMATED HERO BUTTONS
   ======================================== */

/* Book Appointment - Pulse Animation */
.hero-btn-pulse {
    animation: btnPulse 2.5s ease-in-out infinite;
    position: relative;
}

@keyframes btnPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(41, 151, 100, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(41, 151, 100, 0);
    }
}

.hero-btn-pulse:hover {
    animation: none;
}

/* WhatsApp Us - Float with Bounce Animation */
.hero-btn-float {
    animation: whatsappFloat 2s ease-in-out infinite;
}

@keyframes whatsappFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 8px 20px rgba(37, 211, 102, 0.30);
    }
    50% {
        transform: translateY(-6px);
        box-shadow: 0 14px 35px rgba(37, 211, 102, 0.45);
    }
}

.hero-btn-float:hover {
    animation: none;
}

/* Call Us - Shimmer Effect */
.hero-btn-shimmer {
    position: relative;
    overflow: hidden;
}

.hero-btn-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(23, 59, 120, 0.10), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.hero-btn-shimmer:hover::before {
    animation: none;
}

/* ========================================
   15. WHATSAPP FLOATING BUTTON ANIMATION
   ======================================== */

.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: var(--white);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.35);
    z-index: 999;
    font-size: 1.6rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    animation: whatsappFloat 2.5s ease-in-out infinite;
}

.whatsapp-float:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.50);
    animation: none;
}

/* Ripple/Pulse Ring Around WhatsApp Button */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.3);
    animation: ringPulse 2.5s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
}

.whatsapp-float:hover::before {
    animation: none;
}

/* ========================================
   16. RESPONSIVE (Components)
   ======================================== */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-group {
        min-width: auto;
        margin-bottom: 12px;
    }

    .modal {
        padding: 24px;
        margin: 10px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .tabs {
        gap: 2px;
    }

    .tab {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .service-card {
        padding: 22px 18px;
    }

    .toast-container {
        bottom: 80px;
        right: 16px;
        width: calc(100% - 32px);
    }

    .nav-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 20px;
    }

    /* Disable button animations on mobile for better performance */
    .hero-btn-pulse,
    .hero-btn-float,
    .whatsapp-float {
        animation: none !important;
    }
    
    .hero-btn-shimmer::before {
        animation: none !important;
    }

    .whatsapp-float::before {
        animation: none !important;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 11px 20px;
        font-size: 0.88rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    .card {
        padding: 20px;
    }

    .service-card {
        padding: 18px 16px;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .toast-container {
        bottom: 70px;
        right: 12px;
        width: calc(100% - 24px);
    }

    .toast {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .modal {
        padding: 18px 16px;
        margin: 8px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        right: 16px;
        bottom: 16px;
        font-size: 1.3rem;
    }
}