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


:root {
    --bg: #fafafa;
    --fg: #202124;
    --accent: #1a73e8;
    --muted: #5f6368;
    --card: #ffffff;
    --radius: 4px;
    --shadow: 0 1px 3px rgba(60, 64, 67, .3);
    font-family: "Roboto", system-ui, sans-serif;
}

body {
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
}


header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 2rem;
    background: var(--card);
    border-bottom: 1px solid #e8eaed;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent);
}

header input {
    flex: 1;
    padding: .55rem 1rem;
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: var(--radius);
}

.theme-toggle,
.back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--accent);
}

.theme-toggle .material-icons,
.back .material-icons {
    font-size: 24px;
}

.theme-toggle:hover,
.back:hover {
    opacity: .8;
}


#bookGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 24px;
    padding: 32px;
}


.book-card {
  display: flex;
  flex-direction: column;
  background: transparent;        /* remove visible box */
  box-shadow: none;
  border-radius: var(--radius);
  cursor: pointer;
  overflow: visible;
  transition: transform .15s;
  position: relative;
}

.book-card:hover {
    box-shadow: 0 4px 8px rgba(60, 64, 67, .35);
    transform: translateY(-2px);
}

.book-card .cover {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.book-card:hover .cover {
  transform: scale(1.02);
}


.book-card .info {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  background: var(--card);
  padding: 6px 8px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}


.book-card:hover .info {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}



.book-card .title {
    font-size: .9rem;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card .author {
    font-size: .75rem;
    color: var(--muted);
}


.detail-layout {
    max-width: 960px;
    margin: 2rem auto;
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
}

.detail-layout img {
    width: 300px;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid #ddd;
}

.detail-layout .meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-layout .meta h2 {
    font-size: 2rem;
    font-weight: 600;
}

.detail-layout .meta .price {
    font-size: 1.2rem;
    color: var(--accent);
}

.detail-layout .meta button {
    padding: .75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}

.detail-layout .meta button:hover {
    background: #1669c1;
}

.logo {
  display: inline-flex;     
  align-items: center;
  font-size: 1.4rem;
  font-weight: 500;
  gap: 0;                   
  letter-spacing: -0.5px;   
  cursor: pointer;
}
.logo span {
  color: var(--accent);
  transition: color 0.4s ease;
  display: inline-block;    
  margin: 0;                
  padding: 0;
}

.logo span + span {
  margin-left: -1px;
}

.logo:hover span:nth-child(1) {
    color: #4285F4;
}

.logo:hover span:nth-child(2) {
    color: #DB4437;
}

.logo:hover span:nth-child(3) {
    color: #F4B400;
}

.logo:hover span:nth-child(4) {
    color: #4285F4;
}

.logo:hover span:nth-child(5) {
    color: #0F9D58;
}

.logo:hover span:nth-child(6) {
    color: #DB4437;
}

.download-btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  text-align: center;
  transition: background .2s;
}
.download-btn:hover {
  background: #1669c1;
}



html[data-theme="dark"] {
    --bg: #0e0f11;
    --fg: #f1f3f4;
    --accent: #8ab4f8;
    --muted: #9aa0a6;
    --card: #1f2022;
    --shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

html[data-theme="dark"] header,
html[data-theme="dark"] .book-card {
    background: var(--card);
}
html[data-theme="dark"] .book-card .info {
  background: #2c2c2e;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}
