@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Noto+Serif+SC:wght@300;400;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Bitter:ital,wght@0,100..900;1,100..900&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

::selection {
    background-color: var(--selection-color, #FFFF55);
    color: inherit;
}

.font-serif-content {
    font-family: 'Merriweather', 'Noto Serif SC', serif;
}

.font-bitter {
    font-family: 'Bitter', serif;
}

.font-sf-pro {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #e5e7eb;
    border-radius: 20px;
}

/* Hide scrollbar for sidebar but allow scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Upload Page Specifics - Removed old styles as they are now handled via Tailwind classes in index.html */
/* Kept generic classes if used elsewhere, but removing specific old upload layout classes */


.book-shadow {
    box-shadow:
        0px 0px 0px 1px rgba(0, 0, 0, 0.02),
        0px 4px 8px 0px rgba(0, 0, 0, 0.08),
        0px 12px 30px 0px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
}

/* Apple Style Tooltip */
.apple-tooltip {
    background-color: #222222;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    position: absolute;
    /* Removed global centering to allow specific alignment */
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0.2, 1), transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Tooltip Arrow - Common */
.apple-tooltip::after {
    content: '';
    position: absolute;
    /* Removed global left/margin for specific positioning */
    border-width: 5px;
    border-style: solid;
}

/* Tooltip Position: Top (Above button) - Aligned Right */
.tooltip-top {
    bottom: 100%;
    right: 0;
    /* Align right edge with button */
    left: auto;
    margin-bottom: 12px;
    transform: translateY(4px);
    /* Only animate Y */
}

.tooltip-top::after {
    top: 100%;
    right: 19px;
    /* Center of 48px button (24px) - half arrow (5px) = 19px */
    border-color: #222222 transparent transparent transparent;
}

.tooltip-trigger:hover .tooltip-top {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip Position: Bottom (Below button) - Aligned Left */
.tooltip-bottom {
    top: 100%;
    left: 0;
    /* Align left edge with button */
    margin-top: 12px;
    transform: translateY(-4px);
    /* Only animate Y */
}

.tooltip-bottom::after {
    bottom: 100%;
    left: 19px;
    /* Center of 48px button (24px) - half arrow (5px) = 19px */
    border-color: transparent transparent #222222 transparent;
}

.tooltip-trigger:hover .tooltip-bottom {
    opacity: 1;
    transform: translateY(0);
}

.book-shadow:hover {
    box-shadow:
        0px 0px 0px 1px rgba(0, 0, 0, 0.02),
        0px 8px 10px 0px rgba(0, 0, 0, 0.10),
        0px 16px 30px 0px rgba(0, 0, 0, 0.20);
    transform: scale(1.02);
}

/* Scrollbar Hide Utility */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Highlighter Effect */
.highlighter-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.highlighter-mark {
    position: absolute;
    bottom: 2px;
    left: -4px;
    right: -4px;
    height: 60%;
    background-color: var(--selection-color, #FFFF55);
    opacity: 0.4;
    z-index: -1;
    transform: rotate(-1deg);
    border-radius: 4px 8px 6px 12px;
    transition: all 0.3s ease;
}

.highlighter-container:hover .highlighter-mark {
    opacity: 0.8;
    height: 70%;
    transform: rotate(0.5deg) scaleX(1.05);
}