/* ===========================
   GLOBAL
=========================== */

*{
    box-sizing:border-box;
}

:root {
    --primary-color: #003366;
    --light-text-color: azure;
    --btn-hover: #0057b8;
    --btn-border-radius:6px;
    --delete-btn-bkgd-color: red;
}

body{
    margin:0;
    /* padding:20px; */
    font-family:Arial, Helvetica, sans-serif;
    background:#f4f4f4;
    color:#333;
}

.container{
    max-width:1400px;
    margin:auto;
    margin-top: 50px;
    background:#fff;
    padding:20px;
    border-radius:8px;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
}

#permits {
    overflow-x:auto;
}

.pt-10px {
    padding-top: 10px;
}

.mt-10px {
    margin-top:10px;
}

.mb-10px {
    margin-bottom: 10px;
}

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

h1{
    margin:0;
    color:#003366;
    font-size:32px;
}

.subtitle{
    margin-top:8px;
    margin-bottom:30px;
    color:#666;
    font-size:18px;
}

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

.filters{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    align-items:flex-end;
    margin-bottom:25px;
    justify-content: center;
}

.filters label{
    display:flex;
    flex-direction:column;
    min-width:180px;
    font-weight:bold;
}

.filters span{
    margin-bottom:6px;
}

.filters select{
    padding:10px;
    border:1px solid #ccc;
    border-radius:5px;
    font-size:15px;
}

.filters button{
    padding:11px 20px;
    background:#003366;
    color:#fff;
    border:none;
    border-radius:5px;
    cursor:pointer;
    transition:.2s;
    font-size:15px;
}

.filters button:hover{
    background:#0057b8;
}

.exclude-clear-button {
    margin-top: 10px;
    background: #ccc;
    color: #000;
    width: 100%;
}

.note-status {
    padding: 10px;
}

.notes-counts {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 20px;
}

.note-count-card button, .permit-notes-close-btn {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-radius: var(--btn-border-radius);
}

.note-count-card button:hover, .permit-notes-close-btn:hover {
    cursor: pointer;
    /* color: var(--btn-hover); */
    background-color: var(--btn-hover);
}

.zip-code-select-all {
    display:flex;
    flex-direction:row !important;
    align-items: flex-end;
    gap:1rem;
}

.zip-tag-container, .zip-filter-header {
    max-width: 320px;
}

.zip-tags {
    width: 100%;
}

.zip-tags button, .zip-clear-button {
    padding: 5px 8px;
    background-color: #ccc !important;
    color: #000 !important;
}

.zip-input {
    width:100%;
}

#includeZipTags {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

#excludeZipTags span, #includeZipTags span {
    display: inline-block;
    margin-bottom: 10px;
    margin-right: 10px;;
}

#includeZipTags span {
    color: green;
    margin-top: 10px
}

#excludeZipTags span {
    color: red;
}

.notes-container {
    display:flex;
    margin-top:10px;
    gap:1.5rem;
    justify-content: space-around;
}

.note-reminder {
    width: 250px;
}

.note-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.note-buttons button:hover {
    transform: scale(1.05);
}

.save-notes-btn, .delete-notes-btn {
    color: var(--light-text-color);
    padding: 5px 10px;
    border-radius: var(--btn-border-radius);
    border: none;
    transform: scale(1);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}


.save-notes-btn {
    background-color: var(--primary-color);
}

.delete-notes-btn {
    background-color: var(--delete-btn-bkgd-color);
}

.save-notes-btn:hover, .delete-notes-btn:hover {
    cursor: pointer;
}

.save-notes-btn:hover {
    background-color: #0057b8;
}

.note-text {
    resize: none;
    padding:10px;
}

.note-text {
    width: 100%;
    height: 10vh;
    min-height: 150px;
    max-height: 500px;
    box-sizing: border-box;
}

#noteModalMessage {
    margin-bottom: 10px;
}

.textarea-container {
    width: 70%;
    display:flex;
    flex-direction:column;
}

/* ===========================
   CSS GRID TABLE
=========================== */


.table-container{

    width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;

}


.permit-grid{

    display:grid;

    grid-template-columns:
45px    /* # */
110px   /* Date */
130px   /* Permit */
120px   /* Cost */
350px   /* Address */
80px    /* Zip */
600px   /* Contractor */
140px   /* Phone */
150px   /* Website */
300px   /* Contractor Address */
120px   /* City */
150px    /* State */
300px   /* Work Type */
400px   /* Summary */
450px   /* Building Type */
120px    /* Units */
300px   /* Score */
120px   /* Customer Type */
600px   /* Call Reason */
90px;   /* Map */

    width:max-content;
    min-width:3500px;

}

.summary,
.call-reason{
    overflow-wrap:break-word;
    white-space:normal;
}



.permit-grid > div{

    padding:10px;

    border-bottom:1px solid #ddd;

    overflow-wrap:break-word;

    white-space:normal;

    min-width:0;

}



.permit-header{

    background:#003366;

    color:white;

    font-weight:bold;

    position:sticky;

    top:0;

    z-index:5;

}



.permit-row:nth-child(even){

    background:#fafafa;

}


.permit-row:hover{

    background:#eef6ff;

}



.contractor{

    max-width:600px;

}


.summary{

    max-width:650px;

}


.wrap-job{

    max-width:300px;

}


.building{

    max-width:450px;

}


.customer{

    max-width:250px;

}


@media(max-width:1100px) and (min-width:769px){

.permit-grid{

grid-template-columns:

/* 40px
80px
110px
90px
300px
60px
400px
120px
80px
250px
90px
60px
250px
400px
350px
70px
250px
90px
700px
70px; */

40px    /* # */
80px   /* Date */
110px   /* Permit */
120px   /* Cost */
300px   /* Address */
120px    /* Zip */
400px   /* Contractor */
120px   /* Phone */
120px   /* Website */
250px   /* Contractor Address */
120px   /* City */
150px    /* State */
250px   /* Work Type */
400px   /* Summary */
350px   /* Building Type */
120px    /* Units */
250px   /* Score */
120px   /* Customer Type */
700px   /* Call Reason */
120px;   /* Map */

min-width:2800px;

}

}

/* ===========================
   MOBILE CARDS
=========================== */

.mobile-card{
    display:none;
}

.score-badge{
    color:#fff;
    padding:5px 12px;
    border-radius:20px;
    font-weight:bold;
    display:inline-block;
    min-width:45px;
    text-align:center;
}

.mobile-links{
    margin-top:15px;
}

.mobile-links a{
    display:inline-block;
    margin-right:18px;
    margin-top:6px;
    font-weight:bold;
}

/* ===========================
   TABLET
=========================== */

@media (max-width:1100px){

/* body{
    padding:15px;
} */

.container{
    padding:18px;
}

.permit-grid > div{

    font-size:13px;
    padding:8px;

}

}

/* ===========================
   MOBILE
=========================== */

@media (max-width:1065px){

body{
    padding:8px;
}

.container{
    padding:12px;
    width: 100vw;
}

h1{
    font-size:24px;
    line-height:1.3;
}

.subtitle{
    font-size:16px;
    margin-bottom:20px;
}

.filters{
    display:flex;
    flex-direction: row;
    align-items: center;
    gap:12px;
}

.filters label{
    width:auto;
}

.filters select{
    width:100%;
    font-size:16px;
}

.filters button{
    width:100%;
    font-size:17px;
}

.permit-grid{
    display:none;
}

.table-container{
    overflow:visible;
}

.mobile-card{
    display:block;
    width:100%;
    background:#fff;
    border:1px solid #ddd;
    border-radius:10px;
    padding:14px;
    margin-bottom:18px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
}

.mobile-card h3{
    margin:0 0 12px;
    color:#003366;
    font-size:18px;
    line-height:1.4;
    word-break:break-word;
}

.mobile-row{
    margin-bottom:10px;
    line-height:1.5;
    word-break:break-word;
    overflow-wrap:anywhere;
}

.mobile-label{
    display:block;
    font-weight:bold;
    color:#666;
    margin-bottom:2px;
}

.mobile-links{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:15px;
}

.mobile-links a{
    background:#003366;
    color:#fff;
    padding:10px 14px;
    border-radius:6px;
    text-decoration:none;
    font-size:15px;
}

.mobile-links a:hover{
    background:#0057b8;
}

.details-button{
    margin-top:15px;
    width:100%;
    background:#e8eef8;
    border:none;
    padding:12px;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
    font-weight:bold;
}

.details-button:hover{
    background:#d5e3f8;
}

.details{
    display:none;
    margin-top:15px;
    padding-top:15px;
    border-top:1px solid #ddd;
}

.details.open{
    display:block;
}

.zip-filter-header div button {
    margin-bottom: 10px;
}

}

/* ===========================
   EXTRA SMALL PHONES
=========================== */

@media (max-width:480px){

body{
    padding:5px;
}

.container{
    padding:10px;
}

h1{
    font-size:21px;
}

.subtitle{
    font-size:14px;
}

.mobile-card{
    padding:12px;
}

.mobile-card h3{
    font-size:16px;
}

.mobile-links{
    flex-direction:column;
}

.mobile-links a{
    text-align:center;
    width:100%;
}

}

/* ===========================
   320px DEVICES
=========================== */

@media (max-width:320px){

body{
    padding:2px;
}

.container{
    padding:8px;
}

h1{
    font-size:18px;
}

.subtitle{
    font-size:13px;
}

.filters select,
.filters button{
    font-size:15px;
}

.mobile-card{
    padding:10px;
}

.mobile-card h3{
    font-size:15px;
}

.mobile-row{
    font-size:14px;
}

}


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

.pagination{

    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    margin:25px 0;
    width:100%;

}


.pagination button{

    background:#003366;
    color:white;
    border:none;
    padding:10px 14px;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
    white-space:nowrap;

}


.pagination button:disabled{

    background:#999;
    cursor:not-allowed;

}


.pagination span{

    font-weight:bold;
    padding:8px 10px;
    white-space:nowrap;

}


/* DELETE BUTTON MODAL */

.modal-overlay{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.55);

    display:none;

    justify-content:center;

    align-items:center;

    z-index:9999;

}

.modal-overlay.show{

    display:flex;

}

.modal{

    width:400px;

    max-width:90%;

    background:white;

    border-radius:8px;

    padding:24px;

    box-shadow:0 10px 40px rgba(0,0,0,.3);

}

.modal h2{

    margin-top:0;

}

.modal-buttons{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:24px;
    border-radius: var(--btn-border-radius);
}

.modal-cancel{
    background:#ccc;
}

.modal-delete{

    background:#c62828;

    color:white;

}




/* ==========================================
   SAVED SEARCHS
========================================== */

.filter-action-buttons{

    display:flex;

    gap:12px;

    align-items:center;

}


.secondary-button{

    background:#2e7d32;

}


.secondary-button:hover{

    background:#388e3c;

}


#saveSearchModal input{

    width:100%;

    margin-top:10px;

    margin-bottom:20px;

    padding:12px;

    border:1px solid #ccc;

    border-radius:6px;

    font-size:16px;

}





/* MOBILE MENU */

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

html, body {
    overflow-x: hidden; /* prevents slide menu from breaking layout */
}

:root {
    --primary-color: #003366;
    --light-text-color: azure;
    --btn-hover: #0057b8;
    --btn-border-radius: 6px;
}

/***********************/
/******* NAVBAR ********/
/***********************/

nav {
    width: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--light-text-color);
    height: 80px;
    padding: 0 20px;
}

.nav-logo img {
    height: 60px;
}

.nav-welcome {
    margin-left:auto;
    margin-right:20px;
}


/***********************/
/**** DESKTOP MENU *****/
/***********************/

.nav-ul-container ul {
    display:flex;
    gap:2rem;
    list-style:none;
}

.nav-ul-container a {
    text-decoration:none;
    color:var(--light-text-color);
}


/***********************/
/**** HAMBURGER ********/
/***********************/

.menu-toggle {
    display:none;
    background:none;
    border:none;
    color:white;
    font-size:32px;
    cursor:pointer;
}


/***********************/
/**** MOBILE NAV ******/
/***********************/

@media(max-width:600px){

    nav {
        height:70px;
    }

    .nav-logo img {
        height:50px;
    }


    .menu-toggle {
        display:block;
    }


    .nav-welcome {
        display:none;
    }


    .nav-ul-container {

        position:fixed;

        top:5px;
        right:0;

        width:280px;
        height:100vh;

        background:var(--primary-color);

        padding-top:90px;

        transform:translateX(100%);

        transition:
            transform .35s ease-in-out;

        z-index:1000;

        box-shadow:-5px 0 15px rgba(0,0,0,.25);
    }


    .nav-ul-container.open {

        transform:translateX(0);

    }


    .nav-ul-container ul {

        display:flex;

        flex-direction:column;

        gap:30px;

        padding:20px;

    }


    .nav-ul-container a {

        font-size:20px;

    }

}

/* END MOBILE CSS */









/* MEDIA QUERIES */


@media (max-width:1065px){

    .filter-action-buttons{

        display:flex;

        flex-direction:column;

        width:50%;

    }

    .zip-code-select-all {
        align-items: center;
    }

    .filter-action-buttons button{

        width:100%;

    }

}


/* ===========================
   TABLET
=========================== */

@media (max-width:1100px){

    .pagination{

        gap:8px;

    }


    .pagination button{

        padding:9px 12px;
        font-size:13px;

    }


}



/* ===========================
   MOBILE
=========================== */

@media (max-width:1065px){


    .pagination{

        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
        margin:20px 0;

    }


    .pagination span{

        grid-column:1 / 3;
        grid-row:1;
        text-align:center;
        font-size:14px;

    }


    .pagination button{

        width:100%;
        padding:12px 8px;
        font-size:14px;

    }


}



/* ===========================
   320px PHONES
=========================== */

@media (max-width:320px){


    .pagination button{

        font-size:12px;
        padding:10px 5px;

    }


    .pagination span{

        font-size:13px;

    }


}

/* ==========================================
   SAVED SEARCHES MODAL SCROLLING
========================================== */

#savedSearchesModal .modal{

    max-height:80vh;

    display:flex;

    flex-direction:column;

}


#savedSearchesList{

    overflow-y:auto;

    flex:1;

    min-height:0;

    margin-top:15px;

    padding-right:5px;

}


.saved-search-card{

    border:1px solid #ddd;

    border-radius:8px;

    padding:15px;

    margin-bottom:15px;

    background:#fff;

}


.saved-search-card h3{

    margin-top:0;

    color:#003366;

}


#savedSearchesModal .modal-buttons{

    flex-shrink:0;

}



@media(max-width:1065px){

    #savedSearchesModal .modal{

        width:95%;

        max-width:95%;

        max-height:75vh;

        padding:18px;

    }


    .saved-search-card{

        padding:12px;

    }


    .saved-search-card .modal-buttons{

        flex-direction:column;

        gap:8px;

    }


    .saved-search-card .modal-buttons button{

        width:100%;

    }

    .notes-container {
        flex-direction: column;
    }

    .note-buttons {
        display: flex !important;
        flex-direction: row;
        gap: 3rem;
    }

    .save-notes-btn, .delete-notes-btn {
        width: 50%;
        padding: 10px;
    }


.textarea-container {
    width: 100%;
}

}

@media (max-width: 610px) {
    .notes-counts {
        flex-wrap: wrap;
    }
}

@media (max-width: 460px) {
   .zip-code-select-all {
    flex-wrap: wrap;
    justify-content: center;
   }

   .filters label {
    width: 100%;
   }

   .zip-filter {
    align-items: center;
    width: 100%;
   }

   .zip-tag-container {
    width: 100%;
   }

   .zip-tag-container, .zip-filter-header {
    width: 100%;
}

    .filter-action-buttons {
        width: 100%;
    }
}



/* ==========================================
   DESKTOP PERMIT ACCORDION CARDS
========================================== */


.permit-card-desktop{

    background:#fff;

    border:1px solid #ddd;

    border-radius:10px;

    margin-bottom:20px;

    box-shadow:0 2px 8px rgba(0,0,0,.08);

    overflow:hidden;

}



.permit-card-summary{

    display:grid;

    grid-template-columns:

    60px                 /* # / index */
    120px                /* Lead Rating */
    100px                /* Trade */
    120px                /* Reported Cost */
    120px                /* Address */
    minmax(350px, 1fr)   /* Summary */
    80px                 /* Accordion Arrow */
    80px;                /* Map */


    gap:15px;

    align-items:start;

    padding:15px;

    cursor:pointer;

}



.permit-card-summary:hover{

    background:#eef6ff;

}



/* .permit-card-item{

    overflow-wrap:break-word;

} */

.permit-card-item a {
    color:#003366;
    font-weight:bold;
    text-decoration:none;
}

.permit-card-item a:hover {
    text-decoration:underline;
}



.permit-card-item label{

    display:block;

    font-weight:bold;

    color:#003366;

    margin-bottom:5px;

}



.permit-card-item.summary{

    max-width:450px;

}



.accordion-arrow{

    font-size:22px;

    color:#003366;

    transition:.3s;

}


/* ===========================
   DESKTOP ACCORDION CARDS
=========================== */

.permit-card-summary{

    display:grid;

    grid-template-columns:

    60px                 /* # / index */
    120px                /* Lead Rating */
    100px                /* Trade */
    120px                /* Reported Cost */
    120px                /* Address */
    minmax(350px, 1fr)   /* Summary */
    80px                 /* Accordion Arrow */
    80px;                /* Map */


    gap:15px;

    align-items:start;

    padding:15px;

    cursor:pointer;

}


.permit-card-item {

    min-width:0;
    overflow-wrap:anywhere;
    white-space:normal;

}


.permit-card-item.summary {

    max-height:none;
    overflow:visible;

}


.permit-card-item.summary label {

    display:block;
    margin-bottom:5px;

}


.accordion-arrow {

    align-self:center;

}



.permit-accordion{

    display:none;

    padding:0 20px;

}



.permit-accordion.open{

    display:block;

    padding-bottom:20px;

}



.permit-extra-fields{

    display:grid;

    grid-template-columns:
    repeat(4,1fr);

    gap:10px;

}



.permit-extra-field{

    background:#f7f7f7;

    padding:8px;

    border-radius:6px;

    font-size:14px;

}



.permit-extra-field strong{

    display:block;

    color:#003366;

    text-transform:capitalize;

    margin-bottom:5px;

}



/*
Keep mobile version untouched.
*/

@media(max-width:1065px){

    .permit-card-desktop{

        display:none;

    }

}

.permit-index label{
    color:#003366;
}

.permit-index{
    font-weight:bold;
}

.call-reason-field{

    grid-column: span 2;

}

.call-reason-field span{

    display:block;

    line-height:1.5;

}

/* .permit-card-summary{

    max-height:260px;

    overflow:hidden;

} */

.permit-card-summary{

    overflow:visible;

}

.permit-card-item.summary{

    display:-webkit-box;

    line-clamp: 8;

    -webkit-line-clamp:8;

    -webkit-box-orient:vertical;

    overflow:hidden;

}

.permit-card-summary .accordion-arrow{

    transition:.2s;

}


.permit-accordion.open + .accordion-arrow{

    transform:rotate(180deg);

}

@media (min-width:769px){

.permit-card-summary-text {

    min-width:0;

    display:-webkit-box;

    line-clamp: 8;

    -webkit-line-clamp:8;

    -webkit-box-orient:vertical;

    overflow:hidden;

    line-height:1.5;

}


    .permit-card-summary-text label {

        display:block;

        font-weight:bold;

        margin-bottom:5px;

    }


    .permit-map-link a {

        color:#003366;

        font-weight:bold;

    }

}