/* ============================================================
   SIVIA Home Landing Page — Sully-Inspired v5
   Blue gradient bg, content pushed up, clean stats
   ============================================================ */

/* --- Header Greeting Ribbon --- */
.home-header-ribbon {
    padding: 14px 28px 6px;
    animation: homeGreetFadeIn 0.4s ease-out;
}

.home-header-greeting {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.home-header-greeting-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-greeting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.home-greeting-icon svg {
    display: block;
}

.home-header-greeting-text {
    font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a2332;
    letter-spacing: -0.2px;
}

/* --- Stats chips (very subtle, below search) --- */
.home-stats-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.home-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 16px;
    border: none;
    background: transparent;
    font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: #4b6a8a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.1px;
    line-height: 1;
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
}

.home-stat-chip:hover {
    color: #1a3a5c;
    background: rgba(255, 255, 255, 0.5);
}

.home-stat-chip .chip-icon {
    font-size: 0.6rem;
    opacity: 0.7;
}

.home-stat-chip .chip-count {
    font-weight: 500;
    color: inherit;
}

.home-stat-chip:hover .chip-count {
    color: #1a3a5c;
}

.home-stat-chip.chip-active {
    color: #5a9a7a;
}

.home-stat-chip.chip-active:hover {
    color: #3a8a5a;
    background: rgba(255, 255, 255, 0.25);
}

.home-stat-chip.chip-active .chip-icon {
    color: #5a9a7a;
    opacity: 0.7;
}

.home-stat-chip.chip-active .chip-count {
    color: inherit;
}

/* --- Landing Container (centered hero + search) --- */
.home-landing {
    max-width: 660px;
    margin: 0 auto;
    padding: 0 24px 40px;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 12vh;
}

/* --- Hero Section (compact, pushed up) --- */
.home-hero {
    text-align: center;
    margin-bottom: 24px;
    animation: homeGreetFadeIn 0.6s ease-out;
}

.home-hero-title {
    font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
    font-size: 1.85rem;
    font-weight: 500;
    color: #1a2332;
    margin: 0 0 2px 0;
    letter-spacing: -0.4px;
    line-height: 1.15;
}

.home-hero-subtitle {
    font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
    font-size: 1.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 10px 0;
    letter-spacing: -0.4px;
    line-height: 1.15;
}

.home-hero-description {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Search Bar (pill, clean, powerful) --- */
.home-search-wrapper {
    width: 100%;
    max-width: 630px;
    position: relative;
    animation: homeGreetFadeIn 0.7s ease-out;
}

.home-search-bar {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Dark circle icon on the left */
.home-search-icon-circle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a2332;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

.home-search-icon-circle i {
    color: #ffffff;
    font-size: 0.78rem;
}

.home-search-bar input {
    width: 100%;
    padding: 14px 22px 14px 54px;
    font-size: 0.95rem;
    font-family: 'Inter', -apple-system, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 60px !important;
    background: #ffffff;
    color: #1a2332;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.home-search-bar input:focus {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06), 0 8px 32px rgba(0, 0, 0, 0.07);
}

/* When dropdown is open, square the bottom corners */
.home-search-wrapper.dropdown-open .home-search-bar input {
    border-radius: 24px 24px 0 0 !important;
    border-bottom-color: transparent;
}

.home-search-bar input::placeholder {
    color: #b0bec5;
    font-weight: 400;
}

/* --- Patient Dropdown --- */
.home-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    z-index: 100;
    max-height: 380px;
    overflow: hidden;
}

.home-dropdown.show {
    display: block;
    animation: homeDropdownSlide 0.2s ease-out;
}

.home-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.home-dropdown-list::-webkit-scrollbar {
    width: 5px;
}
.home-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}
.home-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* --- Patient Row (inside dropdown) --- */
.home-patient-card {
    display: flex;
    align-items: center;
    padding: 8px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: transparent;
    border-radius: 0;
}

.home-patient-card:hover {
    background: rgba(59, 130, 246, 0.04);
}

.home-patient-card:active {
    background: rgba(59, 130, 246, 0.08);
}

/* Avatar */
.home-patient-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    margin-right: 12px;
    letter-spacing: 0.5px;
}

/* Avatar colors — vibrant clinical palette */
.home-avatar-0 { background: #3b82f6; } /* blue */
.home-avatar-1 { background: #8b5cf6; } /* purple */
.home-avatar-2 { background: #06b6d4; } /* cyan */
.home-avatar-3 { background: #f59e0b; } /* amber */
.home-avatar-4 { background: #10b981; } /* emerald */
.home-avatar-5 { background: #ec4899; } /* pink */

/* Patient Info */
.home-patient-info {
    flex: 1;
    min-width: 0;
}

.home-patient-name {
    font-size: 0.84rem;
    font-weight: 500;
    color: #1a2332;
    margin: 0;
    line-height: 1.3;
}

.home-patient-detail {
    font-size: 0.74rem;
    color: #94a3b8;
    margin: 1px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date */
.home-patient-date {
    font-size: 0.74rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 12px;
    text-align: right;
}

/* Active encounter indicator */
.home-patient-active {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.64rem;
    font-weight: 600;
    color: #16a34a;
    background: rgba(34, 197, 94, 0.08);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

.home-patient-active-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    animation: homePulse 2s ease-in-out infinite;
}

/* --- Dropdown Footer --- */
.home-dropdown-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: 7px 20px;
    text-align: center;
}

.home-view-all-btn {
    background: transparent;
    border: none;
    padding: 5px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
}

.home-view-all-btn:hover {
    background: rgba(59, 130, 246, 0.05);
}

.home-view-all-btn i {
    margin-left: 5px;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.home-view-all-btn:hover i {
    transform: translateX(3px);
}

/* --- No Results --- */
.home-no-results {
    text-align: center;
    padding: 24px 20px;
    color: #94a3b8;
}

.home-no-results i {
    font-size: 1.3rem;
    color: #d1d5db;
    margin-bottom: 6px;
    display: block;
}

.home-no-results p {
    margin: 0;
    font-size: 0.82rem;
}

/* --- Loading --- */
.home-loading {
    text-align: center;
    padding: 20px 0;
    color: #94a3b8;
}

.home-loading p {
    margin-top: 6px;
    font-size: 0.8rem;
}

/* --- Animations --- */
@keyframes homeGreetFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes homePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes homeWave {
    0%   { transform: rotate(0deg); }
    10%  { transform: rotate(14deg); }
    20%  { transform: rotate(-8deg); }
    30%  { transform: rotate(14deg); }
    40%  { transform: rotate(-4deg); }
    50%  { transform: rotate(10deg); }
    60%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .home-header-ribbon {
        padding: 10px 16px 4px;
    }
    .home-greeting-emoji {
        font-size: 1.1rem;
    }
    .home-header-greeting-text {
        font-size: 0.92rem;
    }
    .home-header-stats {
        padding-left: 28px;
        font-size: 0.7rem;
    }
    .home-landing {
        padding: 0 16px 30px;
        padding-top: 8vh;
    }
    .home-hero-title,
    .home-hero-subtitle {
        font-size: 1.6rem;
    }
    .home-hero-description {
        font-size: 0.82rem;
    }
    .home-search-bar input {
        padding: 13px 20px 13px 52px;
        font-size: 0.9rem;
    }
    .home-search-icon-circle {
        width: 34px;
        height: 34px;
    }
    .home-search-icon-circle i {
        font-size: 0.72rem;
    }
    .home-patient-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
}
