/* =========================================================
   PERSONAL LIBRARY
   Global Styles
   ========================================================= */


/* =========================================================
   1. VARIABLES
   ========================================================= */

:root {
    --black: #111111;
    --black-soft: #1a1a1a;

    --gray-900: #242424;
    --gray-700: #555555;
    --gray-500: #777777;
    --gray-400: #999999;
    --gray-300: #d6d6d6;
    --gray-200: #e8e8e8;
    --gray-100: #f3f3f3;

    --white: #ffffff;
    --body-bg: #f7f7f7;

    --sidebar-width: 250px;

    --border-color: #e5e5e5;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   2. RESET / GLOBAL
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background-color: var(--body-bg);
    color: var(--black);

    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 15px;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
a,
input,
textarea,
select {
    font-family: inherit;
}


/* =========================================================
   3. SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    background-color: var(--white);
    border-right: 1px solid var(--border-color);

    z-index: 1000;

    display: flex;
    flex-direction: column;

    transition: transform 0.25s ease;
}


/* Brand */

.sidebar-brand {
    height: 76px;

    padding: 0 24px;

    display: flex;
    align-items: center;

    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand a {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    font-size: 18px;
    font-weight: 700;

    color: var(--black);
}

.brand-icon {
    width: 36px;
    height: 36px;

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

    border-radius: 9px;

    background-color: var(--black);
    color: var(--white);

    font-size: 18px;
}


/* Navigation */

.sidebar-nav {
    padding: 25px 14px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    padding: 0 12px;
    margin-bottom: 9px;

    color: var(--gray-400);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-link {
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;
    margin-bottom: 3px;

    border-radius: var(--radius-sm);

    color: var(--gray-700);

    font-size: 14px;
    font-weight: 500;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.nav-link i {
    width: 20px;

    display: inline-flex;
    justify-content: center;

    font-size: 18px;
}

.nav-link:hover {
    background-color: var(--gray-100);
    color: var(--black);
}

.nav-link.active {
    background-color: var(--black);
    color: var(--white);
}


/* =========================================================
   4. MAIN CONTENT
   ========================================================= */

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}


/* =========================================================
   5. TOPBAR
   ========================================================= */

.topbar {
    min-height: 76px;

    padding: 15px 32px;

    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title {
    margin: 0;

    color: var(--black);

    font-size: 23px;
    font-weight: 700;

    line-height: 1.3;
}

.page-subtitle {
    margin: 4px 0 0;

    color: var(--gray-500);

    font-size: 13px;
}


/* Mobile menu */

.mobile-menu-button {
    width: 42px;
    height: 42px;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 0;

    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);

    color: var(--black);

    font-size: 21px;
}

.mobile-menu-button:focus,
.mobile-menu-button:focus-visible {
    outline: none;
    box-shadow: none;
}


/* Add book button */

.add-book-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 16px;

    border-radius: var(--radius-sm);

    font-size: 13px;
    font-weight: 600;
}

.add-book-button i {
    font-size: 15px;
}


/* =========================================================
   6. PAGE CONTENT
   ========================================================= */

.page-content {
    padding: 32px;
}


/* =========================================================
   7. CONTENT SECTIONS
   ========================================================= */

.content-section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 20px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-title {
    margin: 0;

    color: var(--black);

    font-size: 19px;
    font-weight: 700;
}

.section-subtitle {
    margin: 6px 0 0;

    color: var(--gray-500);

    font-size: 13px;
}

.section-header .btn {
    display: inline-flex;
    align-items: center;

    border-radius: var(--radius-sm);

    font-size: 13px;
    font-weight: 600;
}

.section-header .btn i {
    font-size: 15px;
}


/* =========================================================
   8. BUTTONS
   ========================================================= */

.btn {
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.btn:focus {
    box-shadow: none;
}

.btn-dark {
    background-color: var(--black);
    border-color: var(--black);
}

.btn-dark:hover {
    background-color: var(--black-soft);
    border-color: var(--black-soft);
}

.btn-outline-dark {
    color: var(--black);
    border-color: var(--gray-300);
    background-color: var(--white);
}

.btn-outline-dark:hover {
    background-color: var(--black);
    border-color: var(--black);
    color: var(--white);
}


/* =========================================================
   9. SIDEBAR MOBILE OVERLAY
   ========================================================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;

    background-color: rgba(0, 0, 0, 0.35);

    z-index: 999;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   10. FLOATING BACK TO TOP BUTTON
   ========================================================= */

.back-to-top {
    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 46px;
    height: 46px;

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

    padding: 0;

    background-color: var(--black);
    color: var(--white);

    border: none;
    border-radius: 50%;

    box-shadow: var(--shadow-md);

    font-size: 19px;

    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease,
        background-color 0.2s ease;

    z-index: 900;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--gray-900);
    color: var(--white);
}


/* =========================================================
   11. RESPONSIVE — SMALL TABLET
   ========================================================= */

@media (max-width: 992px) {

    :root {
        --sidebar-width: 250px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

}


/* =========================================================
   12. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .topbar {
        padding: 14px 20px;
    }

    .page-title {
        font-size: 21px;
    }

    .page-subtitle {
        display: none;
    }

    .add-book-button span {
        display: none;
    }

    .add-book-button {
        width: 42px;
        height: 42px;

        padding: 0;
    }

    .add-book-button i {
        font-size: 18px;
    }

    .page-content {
        padding: 24px 20px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-header .btn {
        width: 100%;

        justify-content: center;
    }

    .back-to-top {
        right: 18px;
        bottom: 18px;

        width: 46px;
        height: 46px;
    }

}


/* =========================================================
   13. RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .topbar {
        gap: 10px;
    }

    .topbar-left {
        min-width: 0;
    }

    .page-title {
        font-size: 20px;

        white-space: nowrap;
    }

}