@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background: #f5f5f5;
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 15.5px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

nav .active {
  text-decoration: underline;
  text-underline-offset: 8px;
}


.nav-links a:hover {
    opacity: 1;
}

#filter-bar {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-bottom: 1.5rem;
    font-size: 16px;
    line-height: 2;
}

.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.filter-row input[type="number"],
.filter-row select {
    width: auto;
    padding: .25rem .5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .88rem;
    font-family: inherit;
}

.filter-row input[type="number"] {
    width: 80px;
}

.filter-short {
    width: 120px;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    flex: 1;
}

.filter-right {
    display: flex;
    gap: .6rem;
    flex-shrink: 0;
	margin-bottom: 2rem;
}

/* ── Styled checkboxes ── */
.filter-check {
    display: flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    font-size: .88rem;
    color: #444;
    user-select: none;
}

.filter-check input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}

.filter-check input[type="checkbox"]:checked {
    background: #2980b9;
    border-color: #2980b9;
}

.filter-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#modal {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}
#modal-close:hover {
    background: red;
}


#modal-content {
    display: flex;
    gap: 1.5rem;
}

#modal-cover {
    width: 120px;
	height: 180px;
    border-radius: 4px;
    flex-shrink: 0;
    object-fit: cover; //or contain
}

#modal-details h2 {
    margin-bottom: .5rem;
}

#modal-details p {
    font-size: .9rem;
    color: #555;
    margin-bottom: .3rem;
}

#modal-summary {
    margin-top: .8rem;
    font-size: .85rem;
    color: #666;
    line-height: 1.6;
}

.bookshelf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 3px;
	background: url("shelves.png");
    padding: 20px 20px 5px;
    border-bottom: 12px solid #1a0f09;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.spine {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px 2px 0 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
}

.spine:hover {
    transform: translateY(-8px);
    opacity: 1 !important;
}

.spine-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 90%;
    font-family: Roboto;
    letter-spacing: 0.05em;
}

#book-tags {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .4rem .8rem;
    margin-bottom: .9rem;
}

.spinny {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #555;
  background-color: white;
  cursor: pointer;
  transition: transform 0.4s ease, background-color 0.3s ease;
  transform: rotate(0deg);
}

.spinny:checked {
	background-color: #00D18B;
	transform: rotate(180deg);
}

#book-tags > label:first-child {
    grid-column: 1 / -1;
}

#login-body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f7fa;
    font-family: Roboto;
}

#login-error {
    color: #d93025;
    margin-bottom: 12px;
    font-size: 15px;
}

/* Navbar */
.site-header {
	width: 100%;
    background: #1f2933;
}

.navbar {
    width: 100%;
    max-width: 1200px;
    margin: 0 4%;
	padding: 0 20py;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.logo {
    font-weight: 600;
    font-size: 19px;
	color: white;
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.user {
    font-size: 15.5px;
    opacity: 0.9;
}

/* Logout button (styled form button) */
.logout-form {
    margin: 0;
}

.logout-btn {
    background: #e5533d;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: #c9442f;
}

/* Page container */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}


h1 {
    margin-bottom: 1rem;
	margin-top: 0;
}

/* ── Two-column card layout ── */
.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
}

@media (max-width: 600px) {
    .cards { grid-template-columns: 1fr; }
}

.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #eee;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
	margin-right: 5%;
}

#card-header-second {
	border: solid 1px black;
}

/* ── Fields ── */
.field {
    margin-bottom: .9rem;
}

label {
    display: block;
    font-size: .8rem;
    color: #555;
    margin-bottom: .3rem;
}

input[type="text"],
textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: .45rem .6rem;
    font-family: inherit;
    font-size: .9rem;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #666;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.or-divider {
    text-align: center;
    color: #aaa;
    font-size: .8rem;
    margin: .4rem 0;
}

/* ── Buttons ── */
input[type="submit"],
button {
    padding: .45rem 1rem;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: .9rem;
    cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
    background: #f0f0f0;
}

#btn-clear {
    margin-left: .5rem;
    color: #7d7d7d;
}

/* ── Cover preview ── */
#cover-preview-wrap {
    margin-top: .5rem;
}

#cover-preview-img {
    max-width: 120px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}


  .checkbox-wrapper-10 .tgl {
    display: none;
  }
  .checkbox-wrapper-10 .tgl,
  .checkbox-wrapper-10 .tgl:after,
  .checkbox-wrapper-10 .tgl:before,
  .checkbox-wrapper-10 .tgl *,
  .checkbox-wrapper-10 .tgl *:after,
  .checkbox-wrapper-10 .tgl *:before,
  .checkbox-wrapper-10 .tgl + .tgl-btn {
    box-sizing: border-box;
  }
  .checkbox-wrapper-10 .tgl::-moz-selection,
  .checkbox-wrapper-10 .tgl:after::-moz-selection,
  .checkbox-wrapper-10 .tgl:before::-moz-selection,
  .checkbox-wrapper-10 .tgl *::-moz-selection,
  .checkbox-wrapper-10 .tgl *:after::-moz-selection,
  .checkbox-wrapper-10 .tgl *:before::-moz-selection,
  .checkbox-wrapper-10 .tgl + .tgl-btn::-moz-selection,
  .checkbox-wrapper-10 .tgl::selection,
  .checkbox-wrapper-10 .tgl:after::selection,
  .checkbox-wrapper-10 .tgl:before::selection,
  .checkbox-wrapper-10 .tgl *::selection,
  .checkbox-wrapper-10 .tgl *:after::selection,
  .checkbox-wrapper-10 .tgl *:before::selection,
  .checkbox-wrapper-10 .tgl + .tgl-btn::selection {
    background: none;
  }
  .checkbox-wrapper-10 .tgl + .tgl-btn {
    outline: 0;
    display: block;
    width: 4em;
    height: 2em;
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
  }
  .checkbox-wrapper-10 .tgl + .tgl-btn:after,
  .checkbox-wrapper-10 .tgl + .tgl-btn:before {
    position: relative;
    display: block;
    content: "";
    width: 50%;
    height: 100%;
  }
  .checkbox-wrapper-10 .tgl + .tgl-btn:after {
    left: 0;
  }
  .checkbox-wrapper-10 .tgl + .tgl-btn:before {
    display: none;
  }
  .checkbox-wrapper-10 .tgl:checked + .tgl-btn:after {
    left: 50%;
  }

  .checkbox-wrapper-10 .tgl-flip + .tgl-btn {
    padding: 2px;
    transition: all 0.2s ease;
    font-family: sans-serif;
    perspective: 100px;
  }
  .checkbox-wrapper-10 .tgl-flip + .tgl-btn:after,
  .checkbox-wrapper-10 .tgl-flip + .tgl-btn:before {
    display: inline-block;
    transition: all 0.4s ease;
    width: 100%;
    text-align: center;
    position: absolute;
    line-height: 2em;
    font-weight: bold;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
    border-radius: 4px;
  }
  .checkbox-wrapper-10 .tgl-flip + .tgl-btn:after {
    content: attr(data-tg-on);
    background: #02C66F;
    transform: rotateY(-180deg);
  }
  .checkbox-wrapper-10 .tgl-flip + .tgl-btn:before {
    background: #FF3A19;
    content: attr(data-tg-off);
  }
  .checkbox-wrapper-10 .tgl-flip + .tgl-btn:active:before {
    transform: rotateY(-20deg);
  }
  .checkbox-wrapper-10 .tgl-flip:checked + .tgl-btn:before {
    transform: rotateY(180deg);
  }
  .checkbox-wrapper-10 .tgl-flip:checked + .tgl-btn:after {
    transform: rotateY(0);
    left: 0;
    background: #7FC6A6;
  }
  .checkbox-wrapper-10 .tgl-flip:checked + .tgl-btn:active:after {
    transform: rotateY(20deg);
  }

input[readonly] {
    background: #f0f0f0;
    color: #888;
    cursor: not-allowed;
}

.signin {
    background: #ffffff;
    padding: 40px 35px;
    width: 340px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Title */
.signin h2 {
    margin: 0 0 20px 0;
    font-weight: 600;
}

/* Inputs (uniform style) */
.signin input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 15.5px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* Focus state */
.signin input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* Submit button styled like inputs */
.sumbit_btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #4a90e2;
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.05s ease;
}

.sumbit_btn:hover {
    background: #3a78c2;
}

.sumbit_btn:active {
    transform: scale(0.98);
}

#search-results {
    list-style: none;
    margin-top: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.search-result {
    padding: .6rem .8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
    transition: background .15s;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background: #f5f5f5;
}

.search-result.selected {
    background: #e8f4fd;
    border-left: 3px solid #2980b9;
}

/* ── Error banner ── */
.error-banner {
    max-width: 900px;
    background: #fff3f3;
    border: 1px solid #e88;
    color: #c0000;
    border-radius: 6px;
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* ── Success banner ── */
.success-banner {
    max-width: 900px;
    background: #F3FFF9;
    border: 1px solid #88EEBB;
    color: #00CC66;
    border-radius: 6px;
    padding: .7rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}