/**
 * Hospital Partner Portal - Frontend Styles
 */

/* ===== Container ===== */
.hpp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Single Hospital ===== */
.hpp-single-hospital {
    padding-bottom: 60px;
}

.hpp-hospital-header {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    color: #fff;
    padding: 40px 0;
}

.hpp-hospital-header .hpp-container {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.hpp-hospital-image {
    flex: 0 0 200px;
}

.hpp-hospital-image img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
}

.hpp-hospital-intro {
    flex: 1;
    min-width: 250px;
}

.hpp-hospital-name {
    font-size: 2em;
    margin: 0 0 10px 0;
    color: #fff;
    line-height: 1.2;
}

.hpp-hospital-location {
    font-size: 1.1em;
    opacity: 0.9;
    margin: 0 0 15px 0;
}

.hpp-icon {
    margin-right: 4px;
}

/* ===== Badges ===== */
.hpp-accreditation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hpp-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hpp-badge-accreditation {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* On cards (non-header) */
.hpp-card-badges .hpp-badge-accreditation {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ===== Stats Bar ===== */
.hpp-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hpp-stat {
    flex: 1;
    min-width: 120px;
    padding: 20px;
    text-align: center;
    border-right: 1px solid #e2e8f0;
}

.hpp-stat:last-child {
    border-right: none;
}

.hpp-stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.hpp-stat-value {
    display: block;
    font-size: 1.4em;
    font-weight: 700;
    color: #0c4a6e;
}

.hpp-stat-highlight .hpp-stat-value {
    color: #059669;
}

/* ===== Tabs ===== */
.hpp-tabs {
    margin-bottom: 40px;
}

.hpp-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
    overflow-x: auto;
}

.hpp-tab-btn {
    padding: 14px 24px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.hpp-tab-btn:hover {
    color: #0369a1;
}

.hpp-tab-btn.active {
    color: #0369a1;
    border-bottom-color: #0369a1;
}

.hpp-tab-content {
    display: none;
    padding: 30px 0;
}

.hpp-tab-content.active {
    display: block;
}

/* ===== Sections ===== */
.hpp-section {
    margin-bottom: 30px;
}

.hpp-section h2 {
    font-size: 1.3em;
    color: #1e293b;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

/* ===== Feature List ===== */
.hpp-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.hpp-feature-list li {
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
}

.hpp-check {
    color: #059669;
    font-weight: 700;
    margin-right: 8px;
}

/* ===== Specialty Tags ===== */
.hpp-specialty-grid,
.hpp-specialty-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Add class="hpp-center" to [hpp_specialties] for centred layout
   e.g. [hpp_specialties class="hpp-center"] */
.hpp-specialty-tags.hpp-center {
    justify-content: center;
}

.hpp-specialty-more {
    background: #f1f5f9;
    color: #64748b;
}

.hpp-specialty-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ===== Doctor Grid ===== */
.hpp-doctor-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
}

/* Defeat any theme nth-child / column-span rules */
.hpp-doctor-grid > * {
    grid-column: auto !important;
    grid-row: auto !important;
    float: none !important;
    width: auto !important;
}

/* Hide any stray <br> elements that wpautop may inject into the grid */
.hpp-doctor-grid > br,
.hpp-doctor-card > br {
    display: none !important;
}

.hpp-doctor-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.hpp-doctor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hpp-doctor-photo {
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
}

.hpp-doctor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpp-doctor-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
}

.hpp-doctor-info {
    padding: 15px 20px 20px;
}

.hpp-doctor-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.hpp-doctor-info h3 a {
    color: #0c4a6e;
    text-decoration: none;
}

.hpp-doctor-info h3 a:hover {
    color: #0369a1;
    text-decoration: underline;
}

.hpp-doctor-quals,
.hpp-doctor-designation,
.hpp-doctor-specialty,
.hpp-doctor-exp {
    margin: 3px 0;
    font-size: 13px;
    color: #64748b;
}

.hpp-doctor-designation {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    margin-bottom: 6px;
}

.hpp-doctor-specialty {
    color: #1e40af;
    font-weight: 500;
}

.hpp-doctor-profile-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    text-decoration: none;
}

.hpp-doctor-profile-link:hover {
    text-decoration: underline;
    color: #0c4a6e;
}

/* ===== Gallery ===== */
.hpp-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
}

/* Defeat any theme nth-child / column-span rules */
.hpp-gallery-grid > * {
    grid-column: auto !important;
    grid-row: auto !important;
    float: none !important;
    width: auto !important;
}

/* Hide any stray <br> elements that wpautop may inject into the grid */
.hpp-gallery-grid > br,
.hpp-gallery-image > br {
    display: none !important;
}

.hpp-gallery-image {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: zoom-in;
}

.hpp-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hpp-gallery-image:hover img {
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .hpp-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 560px) {
    .hpp-gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Lightbox ===== */
.hpp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.hpp-lightbox.is-open {
    display: flex;
}

.hpp-lightbox-inner {
    position: relative;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hpp-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    display: block;
}

.hpp-lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 100000;
}

.hpp-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.hpp-lightbox-prev,
.hpp-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 100000;
}

.hpp-lightbox-prev { left: 18px; }
.hpp-lightbox-next { right: 18px; }

.hpp-lightbox-prev:hover,
.hpp-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.hpp-lightbox-counter {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-family: system-ui, sans-serif;
    letter-spacing: 0.5px;
}

@media (max-width: 560px) {
    .hpp-lightbox-prev { left: 8px; }
    .hpp-lightbox-next { right: 8px; }
}

/* ===== CTA Section ===== */
.hpp-cta-section {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
}

.hpp-cta-section h2 {
    color: #fff;
    border: none;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.hpp-cta-section p {
    opacity: 0.9;
    margin-bottom: 20px;
    font-size: 1.05em;
}

.hpp-cta-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #fff;
    color: #0c4a6e;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hpp-cta-btn:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #0c4a6e;
    text-decoration: none;
}

/* ===== Single Doctor ===== */
.hpp-single-doctor {
    padding: 40px 0 60px;
}

.hpp-doctor-profile {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.hpp-doctor-sidebar {
    position: sticky;
    top: 100px;
}

.hpp-doctor-headshot {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.hpp-doctor-headshot img {
    width: 100%;
    height: auto;
}

.hpp-doctor-hospitals {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px 20px;
}

.hpp-doctor-hospitals h3 {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
}

.hpp-doctor-hospitals ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hpp-doctor-hospitals li {
    margin-bottom: 8px;
}

.hpp-doctor-hospitals a {
    color: #0369a1;
    text-decoration: none;
    font-weight: 500;
}

.hpp-doctor-hospitals a:hover {
    text-decoration: underline;
}

.hpp-doctor-hospital-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hpp-doctor-hospital-list li {
    margin-bottom: 6px;
}

.hpp-doctor-hospital-list a {
    color: #0369a1;
    text-decoration: none;
    font-weight: 500;
}

.hpp-doctor-hospital-list a:hover {
    text-decoration: underline;
}

.hpp-doctor-main h1 {
    font-size: 2em;
    margin: 0 0 5px 0;
    color: #0c4a6e;
}

.hpp-doctor-quals-full {
    color: #64748b;
    font-size: 1.05em;
    margin: 0 0 15px 0;
}

.hpp-doctor-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0 30px;
}

.hpp-detail-item {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
}

.hpp-detail-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hpp-detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
}

/* ===== Archive / Hospital Grid ===== */
.hpp-archive-hospitals {
    padding: 40px 0 60px;
}

.hpp-archive-title {
    font-size: 2em;
    color: #0c4a6e;
    margin: 0 0 10px 0;
    text-align: center;
}

.hpp-archive-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1em;
    margin-bottom: 40px;
}

.hpp-hospital-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
}

.hpp-hospital-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hpp-hospital-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.hpp-card-image {
    height: 200px;
    overflow: hidden;
}

.hpp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpp-card-body {
    padding: 20px;
}

.hpp-card-title {
    font-size: 1.2em;
    margin: 0 0 8px 0;
}

.hpp-card-title a {
    color: #0c4a6e;
    text-decoration: none;
}

.hpp-card-title a:hover {
    color: #0369a1;
}

.hpp-card-location {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 10px 0;
}

.hpp-card-badges {
    margin-bottom: 10px;
}

.hpp-card-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.hpp-card-stats span::before {
    content: "•";
    margin-right: 6px;
    color: #0369a1;
}

.hpp-card-stats span:first-child::before {
    display: none;
}

.hpp-card-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.hpp-card-link {
    display: inline-block;
    color: #0369a1;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.hpp-card-link:hover {
    text-decoration: underline;
}

.hpp-no-results {
    text-align: center;
    color: #64748b;
    font-size: 1.1em;
    padding: 60px 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hpp-hospital-header .hpp-container {
        flex-direction: column;
        text-align: center;
    }

    .hpp-hospital-image {
        flex: none;
    }

    .hpp-accreditation-badges {
        justify-content: center;
    }

    .hpp-stats-bar {
        flex-direction: column;
    }

    .hpp-stat {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .hpp-stat:last-child {
        border-bottom: none;
    }

    .hpp-tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .hpp-doctor-profile {
        grid-template-columns: 1fr;
    }

    .hpp-doctor-sidebar {
        position: static;
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }

    .hpp-doctor-headshot {
        max-width: 150px;
    }

    .hpp-hospital-grid {
        grid-template-columns: 1fr;
    }

    .hpp-cta-section {
        padding: 30px 20px;
    }

    .hpp-hospital-name {
        font-size: 1.5em;
    }
}
