@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;500;600;700;800&display=swap');

/* ===========================================================
   LabTest Master — v0.2
   Theme: Medanta light
   Palette pulled from the Medanta mark:
     orange  #F04E30  (the flowing accent lines)
     gray    #6D6E71  (the wordmark / structural bars)
=========================================================== */

:root{
    /* --- brand --- */
    --orange:        #E65B40;
    --orange-dark:   #CC482F;
    --orange-tint:   #FFF0EC;
    --orange-tint-2: #F8D8D0;

    /* --- ink / neutrals (cool gray, not warm cream) --- */
    --ink:        #24242A;
    --gray-700:   #55565C;
    --gray-500:   #83848B;
    --gray-300:   #DEDFE3;
    --gray-200:   #EAEBEE;
    --gray-100:   #F4F5F7;
    --white:      #FFFFFF;

    --danger:     #C6402A;

    /* --- type --- */
    --font-display: 'Lato', sans-serif;
    --font-body:    'Lato', sans-serif;
    --font-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;

    /* --- shape / motion --- */
    --radius-sm:  10px;
    --radius-md:  16px;
    --radius-lg:  22px;
    --shadow-card: 0 1px 2px rgba(36,36,42,.03), 0 8px 24px rgba(36,36,42,.045);
    --shadow-card-hover: 0 4px 10px rgba(36,36,42,.06), 0 16px 32px rgba(240,78,48,.10);
    --ease: cubic-bezier(.2,.7,.3,1);
}

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

html{
    -webkit-tap-highlight-color: transparent;
}

/* Replace default black focus rings with brand-colored ones,
   and only show them for keyboard navigation (not mouse clicks). */
button, select, input, a{
    outline: none;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible{
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

body{
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: var(--font-body);
    background: var(--gray-100);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ===========================================================
   HEADER
=========================================================== */

.app-header{
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -20px 18px;
    padding: 16px 20px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
}

.brand{
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo{
    width: 42px;
    height: auto;
    flex-shrink: 0;
}

.brand-text{
    min-width: 0;
}

.brand-text h1{
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink);
    white-space: nowrap;
}

.lab-selector{
    margin-top: 4px;
    width: 100%;
    max-width: 190px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 5px 8px;
    background: var(--white)
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%2383848B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 9px center;
    appearance: none;
    -webkit-appearance: none;
    color: var(--gray-700);
    font-size: 12.5px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
}

.lab-selector:focus{
    border-color: var(--orange);
}

.menu-btn,
.refresh-btn{
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}

.refresh-btn:hover{
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}

.refresh-btn:active{
    transform: scale(.94);
}

.refresh-btn.is-spinning svg{
    animation: spin .7s linear;
}

@keyframes spin{
    to{ transform: rotate(360deg); }
}

/* ===========================================================
   SEARCH
=========================================================== */

.search-section{
    margin-bottom: 16px;
    position: relative;
}

.search-section::before{
    content:"";
    position:absolute;
    left:18px;
    top:50%;
    width:18px;
    height:18px;
    transform: translateY(-50%);
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2383848B' stroke-width='2'><circle cx='7.5' cy='7.5' r='6'/><path d='M12 12l4.5 4.5' stroke-linecap='round'/></svg>") no-repeat center / contain;
    pointer-events: none;
}

#searchInput{
    width: 100%;
    border: 1px solid var(--gray-200);
    outline: none;
    background: var(--white);
    color: var(--ink);
    padding: 15px 18px 15px 46px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-body);
    box-shadow: var(--shadow-card);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

#searchInput::placeholder{
    color: var(--gray-500);
}

#searchInput:focus{
    border-color: var(--orange);
    box-shadow: 0 0 0 4px var(--orange-tint);
}

/* ===========================================================
   DEPARTMENT FILTERS
=========================================================== */

.department-filters{
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 22px;
    scrollbar-width: none;
}

.department-filters::-webkit-scrollbar{
    display: none;
}

.filter-chip{
    flex-shrink: 0;
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: 30px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.filter-chip:hover{
    border-color: var(--orange);
    color: var(--orange-dark);
}

.filter-chip.active{
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}

/* ===========================================================
   QUICK BUTTONS
=========================================================== */

.quick-buttons{
    display: flex;
    gap: 10px;
    margin-bottom: 26px;
}

.quick-buttons button{
    flex: 1;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    padding: 14px 8px;
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: var(--shadow-card);
}

.quick-buttons button svg{
    width: 20px;
    height: 20px;
    stroke: var(--gray-500);
    transition: stroke .2s var(--ease);
}

.quick-buttons button:hover{
    border-color: var(--orange);
    color: var(--orange-dark);
}

.quick-buttons button:hover svg{
    stroke: var(--orange);
}

.quick-buttons button:active{
    transform: translateY(1px);
}

.quick-buttons button.active{
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}

.quick-buttons button.active svg{
    stroke: var(--white);
}

/* ===========================================================
   TEST LIST + CARDS
=========================================================== */

#testList{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-card{
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 18px 20px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.test-card:hover{
    transform: translateY(-2px);
    border-color: var(--orange-tint-2);
    box-shadow: var(--shadow-card-hover);
}

/* -- specimen tag: signature element --
   Mirrors the torn specimen-label strip on a sample tube:
   monospace code, dashed tear edge, orange ink. */
.top-row{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.code{
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--orange-dark);
    background: var(--orange-tint);
    padding: 4px 10px;
    border-radius: 6px;
    border-right: 2px dashed var(--orange-tint-2);
}

.reporting{
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.reporting::before{
    content:"";
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2383848B' stroke-width='1.6'><circle cx='6' cy='6' r='5'/><path d='M6 3v3l2 1.5' stroke-linecap='round'/></svg>") no-repeat center / contain;
    display: inline-block;
    flex-shrink: 0;
}

.test-name{
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: -.005em;
    color: var(--ink);
    line-height: 1.35;
    margin-bottom: 6px;
}

.sample{
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 0;
    margin-bottom: 14px;
}

.bottom-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

/* -- meta: left side of bottom row, e.g. test method/technique -- */
.meta{
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--gray-500);
    font-size: 12.5px;
    font-weight: 500;
}

.meta::before{
    content:"";
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='none' stroke='%2383848B' stroke-width='1.6'><path d='M5.5 1.5h3M6.2 1.5v4.3L3.3 10a1.3 1.3 0 0 0 1.1 2h5.2a1.3 1.3 0 0 0 1.1-2L7.8 5.8V1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center / contain;
}

.meta span{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta:empty,
.meta:has(span:empty)::before{
    display: none;
}

/* -- price-group: right side of bottom row -- */
.price-group{
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.mrp{
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--orange);
    text-align: right;
}

.favorite{
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-300);
    margin-left: auto;
    transition: color .2s var(--ease), transform .2s var(--ease);
}

.favorite:hover{
    color: #F5C242;
}

.favorite.active{
    color: #F5B800;
    transform: scale(1.12);
}

.arrow{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--orange-tint);
    color: var(--orange);
    font-size: 15px;
    flex-shrink: 0;
}

/* -- Not-available price block -- */

.not-available{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.na-title{
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.na-list{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 12px;
    color: var(--gray-500);
    text-align: right;
}

/* ===========================================================
   EMPTY / ERROR STATES
=========================================================== */

.empty{
    padding: 70px 20px;
    text-align: center;
    color: var(--gray-500);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
}

.empty h3{
    font-family: var(--font-display);
    color: var(--ink);
    font-size: 17px;
    margin-bottom: 8px;
}

.empty p{
    margin-bottom: 18px;
}

.empty button{
    background: var(--orange);
    border: none;
    color: var(--white);
    padding: 12px 22px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s var(--ease);
}

.empty button:hover{
    background: var(--orange-dark);
}

/* ===========================================================
   PAGINATION
=========================================================== */

.pagination{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 10px;
}

.pagination button{
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 11px 18px;
    border-radius: 12px;
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}

.pagination button:hover{
    border-color: var(--orange);
    color: var(--orange-dark);
}

.pagination span{
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
}

/* ===========================================================
   DETAILS PAGE
=========================================================== */

.details-page{
    padding-bottom: 60px;
}

.details-header{
    margin: 20px 0 4px;
}

.back-btn{
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s var(--ease);
}

.back-btn:hover{
    border-color: var(--orange);
    color: var(--orange-dark);
}

.page-title{
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 18px 0 12px;
    line-height: 1.3;
    color: var(--ink);
}

.action-buttons{
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.action-buttons button,
.action-buttons a.button{
    flex: 1;
    padding: 13px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.action-buttons button:hover,
.action-buttons a.button:hover{
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}

.detail-section{
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}

.detail-section h2{
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 14px;
    color: var(--orange-dark);
}

.detail-row{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child{
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row:first-child{
    padding-top: 0;
}

.detail-row span{
    color: var(--gray-500);
    font-size: 13.5px;
    width: 42%;
    flex-shrink: 0;
    padding-top: 1px;
}

.detail-row strong{
    width: 58%;
    text-align: right;
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    color: var(--ink);
}

.detail-section p{
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 14px;
}

/* Similar-test rows read as links */
.detail-row[onclick]{
    cursor: pointer;
    transition: background .15s var(--ease);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 8px;
}

.detail-row[onclick]:hover{
    background: var(--orange-tint);
}

.detail-row[onclick] span{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--orange-dark);
    width: auto;
}

.detail-row[onclick] strong{
    width: auto;
    flex: 1;
    text-align: left;
    font-weight: 500;
}

/* ===========================================================
   RESPONSIVE
=========================================================== */

@media (min-width: 560px){
    .test-name{ font-size: 17.5px; }
    .page-title{ font-size: 28px; }
}

@media (max-width: 380px){
    body{ padding: 0 14px 50px; }
    .app-header{ margin: 0 -14px 16px; padding: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
    *{
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
    }
}
