﻿@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Scrollbar for Tree View & Tables */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Hide scrollbar for clean horizontal scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Typography Overrides */
.prose h2 {
    color: #1e3a8a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}
.prose h3 {
    color: #475569;
    margin-top: 1.5rem;
}

/* Breadcrumb Divider */
.breadcrumb-separator::after {
    content: "/";
    margin: 0 0.5rem;
    color: #94a3b8;
}

/* Tree View Lines */
.tree-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e2e8f0;
}

/* 3D Book Styles */
.perspective-1000 {
    perspective: 1000px;
}
.book-container {
    position: relative;
    transform-style: preserve-3d;
}
.book-cover {
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden; /* Hide back of cover when rotated */
    z-index: 20;
}
/* Inside of the Front Cover (visible when opened) */
.book-cover-inside {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg) translateZ(1px); /* translateZ to avoid z-fighting */
    backface-visibility: hidden;
    background: #f8fafc;
    z-index: 19;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.05);
}

/* The Page Underneath */
.book-page {
    position: absolute;
    inset: 4px 0 4px 4px; /* Slightly smaller */
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0 4px 4px 0;
    z-index: 5;
    box-shadow: inset 10px 0 20px -10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.book-open .book-cover {
    transform: rotateY(-140deg);
}
/* PDF Page Flip Animation */
.book-viewer-3d {
    perspective: 2000px; /* Enhanced depth */
}
.pdf-page-canvas {
    transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1); /* Slower, smoother bezier */
    transform-style: preserve-3d;
    transform-origin: left center; /* Always pivot from spine */
    backface-visibility: hidden;
}

/* Next Page (Right -> Left) */
/* Step 1: Current page flips UP and LEFT */
.flip-out-next {
    /* "Upward" flip effect: rotate slightly on X to lift, and flip Y */
    transform: rotateY(-90deg) rotateX(5deg) scale(1.05) translateZ(50px);
    opacity: 1; /* Keep visible */
}
/* Step 2: New page flips DOWN from LEFT */
.flip-in-next-start {
    transform: rotateY(90deg) rotateX(5deg) scale(1.05) translateZ(50px);; /* Start position */
}

/* Prev Page (Left -> Right) */
/* Step 1: Current page flips UP and RIGHT */
.flip-out-prev {
    transform: rotateY(90deg) rotateX(5deg) scale(1.05) translateZ(50px);;
    opacity: 1;
}
/* Step 2: New page flips DOWN from RIGHT */
.flip-in-prev-start {
    transform: rotateY(-90deg) rotateX(5deg) scale(1.05) translateZ(50px);; /* Start position */
}
