@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --base-clr: #11121a;
    --line-clr: #42434a;
    --hover-clr: #222533;
    --text-clr: #e6e6ef;
    --accent-clr: #5e63ff;
    --secondary-text-clr: #b0b3c1;
}

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

html {
    font-family: 'Poppins', sans-serif;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--base-clr);
    color: var(--text-clr);
    display: grid;
    grid-template-columns: auto 1fr;
}

main {
    padding: min(30px, 7%);
}

.container {
    max-width: 900px;
}

h1 {
    margin-bottom: 1rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/*
select,
input[type="date"] {
    background-color: var(--hover-clr);
    color: var(--text-clr);
    border: 1px solid var(--line-clr);
    border-radius: 8px;
    padding: 0.5rem;
} */

.viewinspect-btn {
    background-color: var(--accent-clr);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    max-width: 200px;
    cursor: pointer;
}

#prevBtn,
#nextBtn {
    background-color: var(--accent-clr);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

#message {
    margin: 0.75rem 0;
    color: var(--secondary-text-clr);
}

.card {
    border: 1px solid var(--line-clr);
    border-radius: 10px;
    background-color: var(--hover-clr);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.card-header {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.card-sub {
    font-size: 0.85rem;
    color: var(--secondary-text-clr);
    margin-bottom: 0.5rem;
}

.photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.photos img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line-clr);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.inspection-photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.inspection-photos img {
    width: 100%;
    aspect-ratio: 5 / 4;
    /* consistent shape */
    object-fit: cover;
    /* crop instead of stretch */
    border-radius: 6px;
    border: 1px solid var(--line-clr);
    cursor: pointer;
}

.inspection-photos a {
    background-color: #0f1017;
    border-radius: 6px;
    padding: 2px;
    display: block;
}
/*
.inspection-photos img:hover {
    outline: 2px solid var(--accent-clr);
}
*/
.inspection-card {
    border: 1px solid var(--line-clr);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: #191b27;
}

.inspection-header {
    font-size: 0.9rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

#dateFilter { display: none; }

/* ---------- PHOTO MODAL ---------- */

.photo-modal.hidden {
  display: none;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);

  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;

  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
}

#closeModal {
  position: fixed;            
  top: 16px;
  right: 16px;

  background: var(--accent-clr);
  border: none;
  color: #fff;
  font-size: 1.25rem;

  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}



@media(max-width: 800px) {
    body {
        grid-template-columns: 1fr;
    }

    main {
        padding: 2em 1em 60px 1em;
    }
}

@media (max-width: 900px) {
    .inspection-photos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .inspection-photos {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .inspection-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.35rem;
    }

    .inspection-photos img {
        aspect-ratio: 1 / 1;
        /* square thumbnails on mobile */
    }
}