:root {

    /* Farben */
    --color-surface: #ffffff;
    --color-bg: #faf9f8;
    --color-page-frame: #ffffff;
    --color-border-soft: #e3dfd8;

    --color-text-main: #222222;
    --color-text-muted: #666666;
    --color-text-btn: #ffffff;

    --color-link: #c0392b;
    --color-link-hover: #a93226;

    --color-accent-1: #f39c12;
    --color-accent-2: #1f618d;
    --color-accent-3: #000000;
    --color-accent-4: #e57373;

    /* Typografie */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

    --font-size-base: 16px;
    --font-size-nav: 1rem;

    /* Abstände */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    /* Radius */
    --radius-pill: 999px;

    /* Schatten */
    --shadow-soft: 0 8px 20px rgba(0,0,0,0.12);
}


/*  GLOBAL */

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    color: var(--color-text-main);
    background: var(--color-bg);
}

.title {
    font-family: var(--font-main);
    color: var(--color-text-main);
    font-size: var(--font-size-title);
}
/* PAGE WRAPPER */

.page-frame {
    width: min(1600px, 100%);
    margin-inline: auto;
    padding:
            clamp(1rem, 3vw, 3rem)
            clamp(1rem, 5vw, 5rem);
    background: var(--color-page-frame);
}
/* LINKS */

a:hover {
    color: var(--color-link-hover);
}

/* HEADER */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    padding-block: 1rem;
    margin-bottom: clamp(2rem, 6vw, 6rem);
}
/* Header Grundlayout */

.header-container {
    display: flex; /* alles in eine Reihe */
    align-items: center; /* vertikal mittig */
    justify-content: space-between; /* verteilt alles */
    padding: 15px 30px;
}

.header-container > *:not(:first-child) {
    border-left: 2px solid #ccc; /* Dicke der Linie */
    padding-left: 20px; /* Abstand nach der Linie */
    margin-left: 20px; /* Abstand vor der Linie */
}

/* Trennstrich vor jedem Link außer dem ersten */

.nav a:not(:first-child) {
    border-left: 2px solid #ccc;
    padding-left: 15px;
}

.search-bar input {
    padding: 6px 10px;
    border-radius: 20px; /* rund */
    border: 1px solid #ccc;
}

.auth button {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background-color: black;
    color: white;
}

.site-header {
    border-bottom: 2px solid #ccc;
}


/* Navigation */

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: clamp(1rem, 3vw, 3rem);
}

.main-nav a {
    font-size: var(--font-size-nav);
    color: var(--color-text-main);
    transition: 0.2s ease;
    text-decoration: none;
    font-weight: 400;
}

.main-nav a:hover {
    color: var(--color-link);
}

.main-nav a.active {
    font-weight: 700;
}

/* Suche + Button */

.top-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}


/* Inputs */

input[type="search"] {
    font: inherit;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-pill);
    padding: 0.7rem 1rem;
    min-width: 220px;
}

input[type="search"]:focus {
    outline: none;
    border-color: var(--color-link);
}


/* Button */

.btn-signup {
    border: none;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.4rem;
    background: #111;
    color: white;
    cursor: pointer;
    transition: 0.2s ease;
}


.btn-signup:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);

    background: var(--color-link);
    color: var(--color-text-btn);
}

/* BÜCHER GRID */

.book-box {
    background: var(--color-surface);
    border: 1px solid #ddd;
    border-radius: 12px;

    padding: 12px;          /* kleiner */
    min-height: 200px;      /* kleiner */
    text-align: center;

    width: 100%;
    box-sizing: border-box;
    position: relative;

    display: flex;          /* NEU: für zentriertes Bild */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;    /* Bild horizontal zentriert */

}

.book-box-cover {
    opacity: 1;
    display: block;

    width: 100%;
    max-width: 130px;       /* kleiner */
    height: 195px;

    margin: 0 auto;         /* zentriert */
    border-radius: 4px;
    object-fit: cover;
    transition: .5s ease;
    backface-visibility: hidden;
}

.middle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: .5s ease;
}

.book-box:hover .book-box-cover {
    opacity: 0.3;
}

.book-box:hover .middle {
    opacity: 1;
}

.text-book-box a {
    background-color: #fffaf5;
    color: #3a2412;
    font-size: 16px;
    padding: 16px 32px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    width: 100%;
}

.profile-book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    width: 100%;
}

.container {
    display: flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* FOOTER */

.footer {
    border-top: 2px solid #ccc;

    margin-top: 50px;
    padding: 20px 0;

    display: flex;
    justify-content: center;
}

.footer a {

    font-size: var(--font-size-nav);
    color: var(--color-text-main);
    transition: 0.2s ease;
    text-decoration: none;
}

.footer a:hover {
    color: var(--color-link);
}

/* SUCHE NACH BÜCHERN */

.search-wrapper {
    position: relative;
}

/* Fixer Kasten unter der Suchleiste, verschiebt nie das Layout */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-height: 380px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    z-index: 50;
}

.search-dropdown.is-open {
    display: block;
}

.search-section-label {
    position: sticky;
    top: 0;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    color: var(--color-text-main);
}

/* Abwechselnde Hintergrundfarbe der Ergebnisse */
.search-result-even {
    background: var(--color-surface);
}

.search-result-odd {
    background: var(--color-bg);
}

.search-result-item:hover {
    background: var(--color-border-soft);
}

/* Bücher: kleines Cover + zentrierter Titel + Autor, untereinander */
.search-result-book {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem 1rem;
}

.search-result-book img {
    width: 42px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.35rem;
}

.search-result-book .result-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-result-book .result-author {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Freunde: einfache Zeile mit Username */
.search-result-user {
    justify-content: flex-start;
    font-weight: 500;
    gap: 0.6rem;
}

.result-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}


.search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}


a {
    color: var(--color-text-main);
}

