/* ========================================
   Prescription Search Page Styles
   ======================================== */

.prescription-page {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 18%, rgba(20, 184, 166, 0.14), transparent 30%),
        radial-gradient(circle at 84% 12%, rgba(245, 158, 11, 0.12), transparent 26%),
        linear-gradient(180deg, #f4fbfa 0%, #f7f9fc 45%, #f8fafc 100%);
}

.rx-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.rx-hero {
    position: relative;
    padding: 56px 0 28px;
}

.rx-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    pointer-events: none;
}

.rx-orb-left {
    width: 280px;
    height: 280px;
    top: 100px;
    left: -80px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.16) 0%, rgba(15, 118, 110, 0) 72%);
}

.rx-orb-right {
    width: 360px;
    height: 360px;
    top: 24px;
    right: -100px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.14) 0%, rgba(217, 119, 6, 0) 72%);
}

.rx-search-panel {
    margin-top: 0;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 26px 60px -34px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px);
}

.rx-search-form {
    margin: 0;
}

.rx-search-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 14px 14px 20px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.rx-search-field {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

.rx-search-bar:focus-within {
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow:
        0 0 0 5px rgba(20, 184, 166, 0.12),
        0 16px 32px -26px rgba(15, 118, 110, 0.5);
}

.rx-search-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    box-shadow: 0 14px 24px -18px rgba(15, 118, 110, 0.9);
}

.rx-search-icon svg {
    width: 22px;
    height: 22px;
}

.rx-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 18px;
    font-weight: 500;
}

.rx-search-input::placeholder {
    color: #94a3b8;
}

.rx-search-input:focus {
    outline: none;
}

.rx-search-submit {
    border: none;
    border-radius: 999px;
    padding: 0 28px;
    height: 56px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 18px 28px -18px rgba(15, 118, 110, 0.9);
}

.rx-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 34px -18px rgba(15, 118, 110, 0.85);
}

.rx-search-note {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 0;
    margin-left: auto;
    color: #64748b;
    font-size: 14px;
    text-align: right;
}

.rx-query-echo {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-weight: 600;
}

.rx-chip-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.rx-chip-row-center {
    justify-content: center;
}

.rx-chip-form,
.rx-inline-form {
    margin: 0;
}

.rx-chip {
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f766e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rx-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.3);
    box-shadow: 0 12px 24px -20px rgba(15, 118, 110, 0.7);
}

.rx-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.rx-entry-card {
    padding: 22px 22px 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 20px 34px -30px rgba(15, 23, 42, 0.4);
}

.rx-entry-label,
.rx-discovery-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rx-entry-card h2,
.rx-discovery-card h3,
.rx-empty-card h3 {
    margin-top: 14px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.35;
}

.rx-entry-card p,
.rx-discovery-card p,
.rx-empty-card p {
    margin-top: 10px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.rx-results-section {
    padding: 0 0 88px;
}

.rx-results-layout {
    margin-top: 8px;
}

.rx-side-card {
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 26px 40px -34px rgba(15, 23, 42, 0.45);
}

.rx-side-card + .rx-side-card {
    margin-top: 18px;
}

.rx-side-card h3 {
    color: #0f172a;
    font-size: 16px;
}

.rx-side-list {
    list-style: none;
    margin-top: 14px;
}

.rx-side-list li {
    position: relative;
    padding-left: 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
}

.rx-side-list li + li {
    margin-top: 10px;
}

.rx-side-list li::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #f59e0b);
}

.rx-side-card-accent {
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.94) 0%, rgba(255, 251, 235, 0.96) 100%);
}

.rx-side-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.rx-side-tags span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 13px;
    font-weight: 600;
}

.rx-main-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rx-result-card,
.rx-empty-card,
.rx-discovery-card {
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 26px 42px -34px rgba(15, 23, 42, 0.45);
}

.rx-result-card {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rx-result-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: 0 32px 52px -36px rgba(15, 118, 110, 0.45);
}

.rx-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.rx-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rx-result-index {
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rx-result-tag {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.rx-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rx-action-btn {
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.rx-action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.12);
}

.rx-action-btn:disabled {
    cursor: default;
    opacity: 0.78;
    transform: none;
}

.rx-action-btn-secondary {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.16);
    color: #b45309;
}

.rx-action-btn-secondary:hover {
    border-color: rgba(217, 119, 6, 0.28);
    background: rgba(217, 119, 6, 0.12);
}

.rx-result-text {
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfffe 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #1e293b;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.rx-empty-card {
    text-align: center;
}

.rx-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(245, 158, 11, 0.1));
    color: #0f766e;
}

.rx-empty-icon svg {
    width: 32px;
    height: 32px;
}

.rx-discovery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.rx-text-link {
    margin-top: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: #0f766e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.rx-text-link:hover {
    color: #0d9488;
}

@media (max-width: 1080px) {
    .rx-entry-grid,
    .rx-discovery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .rx-shell {
        width: min(100% - 32px, 1180px);
    }

    .rx-hero {
        padding: 48px 0 56px;
    }

    .rx-search-panel,
    .rx-result-card,
    .rx-empty-card,
    .rx-discovery-card,
    .rx-side-card,
    .rx-entry-card {
        padding: 22px;
        border-radius: 24px;
    }

    .rx-search-bar {
        align-items: stretch;
        flex-wrap: wrap;
        border-radius: 28px;
    }

    .rx-search-field {
        width: 100%;
    }

    .rx-search-submit {
        width: 100%;
    }

    .rx-search-note {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 560px) {
    .rx-search-panel,
    .rx-result-card,
    .rx-empty-card,
    .rx-discovery-card,
    .rx-side-card,
    .rx-entry-card {
        padding: 18px;
    }

    .rx-search-bar {
        gap: 14px;
        padding: 14px;
    }

    .rx-search-icon {
        width: 44px;
        height: 44px;
    }

    .rx-search-input {
        width: 100%;
        font-size: 16px;
    }

    .rx-search-note {
        font-size: 13px;
    }

    .rx-result-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .rx-result-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
