﻿/* ?? Full-page background */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: url('../images/wbg.png') no-repeat center center fixed;
    background-size: cover;
}

    /* White overlay */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.45);
        z-index: 0;
    }

/* ================================
      MAIN WRAPPER CENTER
================================ */
.center-wrapper {
    width: 100%;
    height: 85vh;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    position: relative;
    z-index: 1;
}

/* WHITE MAIN CARD */
.telephone-directory {
    width: 92%;
    max-width: 900px;
    height: 80vh; /* Added a height so scrolling is actually visible */
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    /* Corrected the alpha value from 5 to 0.15 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    /* 'auto' only shows scrollbar when needed */
    overflow-y: scroll;
    position: relative;
}

/* ================================
      FIXED TOP CONTENT
================================ */
.fixed-top-content {
    background: rgba(255,255,255,0.98);
    padding: 20px 20px 15px;
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(3px);
    border-bottom: 1px solid #ddd;
}

/* ================================
      .3
    +
================================ */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: nowrap;
}

.left-logo,
.right-logo {
    flex: 0 0 auto;
}

.left-logo {
    max-width: 150px;
    border-radius: 5px;
    box-shadow: 0px 10px 20px 5px rgba(0, 0, 0, 0.3);
}

.right-logo {
    max-width: 100px;
    border-radius: 5px;
    box-shadow: 0px 5px 10px 5px rgba(0, 0, 0, 0.3);
}

/* --- Base Styles (Common) --- */
.title-box {
    flex: 1;
    text-align: center;
    padding: 0 5px; /* Mobile par padding kam rakhein */
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    /* 1. Safari/iPhone Gradient Text Fix */
    .title-box h2,
    .title-box p {
        font-weight: 700;
        background: linear-gradient(135deg, #007e3e 0%, #004d26 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent; /* Safari priority */
        filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.2));
        white-space: normal;
        display: block;
        line-height: 1.2;
        margin: 0 auto;
    }

/* ================================
      CONTACT INFO
================================ */
.contact-info {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 0 10px;
}

    .contact-info strong {
        color: #1b3b6f;
    }

/* ================================
      SEARCH BOX + LOGIN BUTTON
================================ */
.search-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
}

#searchBox {
    width: 350px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid #777;
    border-radius: 6px;
    font-size: 15px;
}

.btn-login {
    padding: 8px 20px;
    background: #1b3b6f;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

    .btn-login:hover {
        background: #244c8a;
    }

/* ================================
      DIRECTORY LIST AREA
================================ */
.directory-scroll-area {
    width: 92%;
    max-width: 900px;
    margin: 10px auto 80px;
    padding-bottom: 20px;
}

/* SECTION TITLE */
.section-title {
    background: #000;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px 6px 0 0;
    font-size: 18px;
    font-weight: bolder;
}

/* ================================
      TABLE SCROLL WRAPPER  (NEW)
================================ */
.table-scroll-box {
    width: 100%;
    max-height: 450px;
    overflow-y: auto;
    /* Horizontal scroll enable karein */
    overflow-x: auto;
    /* iPhone smooth scrolling ke liye */
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ccc;
}

    /* ================================
      PERFECT 2-ROW STICKY HEADER
================================ */

    /* First header row */
    .table-scroll-box thead tr:first-child th {
        position: static;
        top: 0;
        background: #f0f3f8;
        z-index: 10;
        box-shadow: inset 0 -1px 0 #ccc; /* Border bottom in sticky */
    }

    /* Second header row */
    .table-scroll-box thead tr.subhead th {
        position: static;
        top: 28px; /* exact height of first header row */
        background: #e8edf5; /* slightly darker for clarity */
        z-index: 25;
    }


/* ================================
      TABLE STYLE
================================ */
.directory-table {
    width: 100%;
    /* Table ko sikudne se rokne ke liye */
    min-width: 600px;
    border-collapse: collapse;
}

    .directory-table th {
        border: 1px solid #ccc;
        padding: 6px 10px;
        text-align: center;
    }

    .directory-table td {
        border: 1px solid #ccc;
        padding: 6px 10px;
        text-align: left;
    }

    .directory-table th {
        background: #f0f3f8;
        color: #1b3b6f;
        font-weight: bold;
    }

    .directory-table tr:nth-child(even) td {
        background: #fafafa;
    }
/* ================================
      PAGINATION FIX
================================ */
.bottom-nav {
    position: fixed;
    /* Footer ke thik upar rakhne ke liye adjust kiya gaya */
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 999; /* Footer se thoda niche lekin content se upar */
    width: auto;
    justify-content: center;
}

    .bottom-nav button {
        background: #1b3b6f;
        color: white;
        padding: 8px 20px;
        border-radius: 50px; /* Fully rounded pill shape */
        border: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
        white-space: nowrap;
    }

        .bottom-nav button:hover {
            background: #244c8a;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        }

        .bottom-nav button:active {
            transform: translateY(0);
        }
/* ================================
      MOBILE RESPONSIVE
================================ */
@media only screen and (min-width: 320px) and (max-width: 375px) {
    .left-logo {
        width: 45px;
    }

    .right-logo {
        width: 40px;
    }

    .title-box h2 {
        font-size: 15px !important; /* Original 22px se kam kiya */
        margin-bottom: 2px;
    }

    .title-box p {
        font-size: 10px !important; /* Original 14px se kam kiya */
        font-weight: 600;
    }

    .header-inner {
        padding: 5px;
    }

    .contact-info {
        font-size: 9px;
    }
    .search-container {
       
        gap: 8px;
    }

    #searchBox {
        width: 100% !important;
        max-width: 100%;
        font-size: 14px;
    }

    .btn-login {
        width: 50%;
        text-align: center;
    }
    title-box {
        padding: 0 5px; /* Side padding kam kar di */
        flex: 2; /* Title ko logos ke muqable thodi zyada jagah di */
    }
    .bottom-nav {
        /* Mobile footer chhota hai, isliye gap kam kiya */
        bottom: 35px;
        gap: 8px;
    }

        .bottom-nav button {
            padding: 6px 16px;
            font-size: 12px;
            /* Mobile par touch targets bade hone chahiye */
            min-width: 80px;
        }
}

@media only screen and (min-width: 376px) and (max-width: 430px) {
    .left-logo {
        width: 60px;
    }

    .right-logo {
        width: 45px;
    }

    .title-box h2 {
        font-size: 15px !important; /* Original 22px se kam kiya */
        margin-bottom: 2px;
    }

    .title-box p {
        font-size: 10px !important; /* Original 14px se kam kiya */
        font-weight: 600;
    }

    .header-inner {
        padding: 8px;
    }

    .search-container {
        gap: 8px;
    }

    #searchBox {
        width: 100% !important;
        max-width: 100%;
        font-size: 14px;
    }

    .btn-login {
        width: 50%;
        text-align: center;
    }
    .bottom-nav {
        /* Mobile footer chhota hai, isliye gap kam kiya */
        bottom: 35px;
        gap: 8px;
    }

        .bottom-nav button {
            padding: 6px 16px;
            font-size: 12px;
            /* Mobile par touch targets bade hone chahiye */
            min-width: 80px;
        }
}

@media only screen and (min-width: 431px) and (max-width: 600px) {
    .left-logo {
        width: 75px;
    }

    .right-logo {
        width: 55px;
    }

    .title-box h2 {
        font-size: 15px !important; /* Original 22px se kam kiya */
        margin-bottom: 2px;
    }

    .title-box p {
        font-size: 10px !important; /* Original 14px se kam kiya */
        font-weight: 600;
    }

    .search-container {
        gap: 8px;
    }

    #searchBox {
        width: 100% !important;
        max-width: 100%;
        font-size: 14px;
    }

    .btn-login {
        width: 50%;
        text-align: center;
    }
    .title-box {
        padding: 0 8px;
        flex: 1.5;
    }
    .bottom-nav {
        /* Mobile footer chhota hai, isliye gap kam kiya */
        bottom: 35px;
        gap: 8px;
    }

        .bottom-nav button {
            padding: 6px 16px;
            font-size: 12px;
            /* Mobile par touch targets bade hone chahiye */
            min-width: 80px;
        }
}
@media (min-width: 601px) and (max-width: 768px) {
    .left-logo {
        width: 90px;
    }

    .right-logo {
        width: 65px;
    }

    .title-box h2 {
        font-size: 20px;
    }

    .title-box p {
        font-size: 13px;
    }

    .header-inner {
        padding: 10px 20px;
    }
    .title-box {
        padding: 0 8px;
        flex: 1.5;
    }
}


