/* ==========================================================================
   ELITE ANNUAL TRADER BOOK CSS
   Glassmorphism, 3D Book Rendering, Foil Textures
   ========================================================================== */

/* Layout & Globals */
.bok-container { margin-left: 20px; padding: 32px; min-height: 100vh; color: #ffffff; font-family: 'Inter', sans-serif; position: relative; overflow-x: hidden; display: flex; flex-direction: column; }
.bok-layout { display: flex; gap: 32px; align-items: flex-start; flex-grow: 1; }
.bok-config { width: 340px; flex-shrink: 0; position: sticky; top: 24px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
.bok-config::-webkit-scrollbar { width: 4px; }
.bok-config::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.bok-preview-stage { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }

/* Utilities */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.hidden-mobile { display: flex; }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } .bok-layout { flex-direction: column; } .bok-config { width: 100%; position: relative; max-height: none; } }
.m-0 { margin: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; } .p-16 { padding: 16px; } .pt-16 { padding-top: 16px; } .pb-16 { padding-bottom: 16px; } .px-16 { padding-left: 16px; padding-right: 16px; } .border-bottom { border-bottom: 1px solid rgba(255,255,255,0.1); } .border-top { border-top: 1px solid rgba(255,255,255,0.1); }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.85rem; } .text-muted { color: rgba(255,255,255,0.6); } .w-full { width: 100%; } .w-40 { width: 40px; } .text-center { text-align: center; } .text-right { text-align: right; } .italic { font-style: italic; }
.uppercase { text-transform: uppercase; } .letter-spacing { letter-spacing: 1px; } .font-bold { font-weight: 700; } .tabular-nums { font-variant-numeric: tabular-nums; }
.flex-between { display: flex; justify-content: space-between; align-items: center; } .flex-align-center { display: flex; align-items: center; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .flex-grow { flex-grow: 1; min-height: 0; } .flex-shrink-0 { flex-shrink: 0; }

/* Palette */
.text-purple { color: #c084fc; } .text-cyan { color: #06b6d4; } .text-gold { color: #fbbf24; } .text-red { color: #ef5350; } .text-green { color: #22c55e; } .text-white { color: #ffffff; }
.bg-purple { background: #c084fc; color: #000; } .bg-cyan { background: #06b6d4; color: #000; } .bg-gold { background: #fbbf24; color: #000; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); } 70% { box-shadow: 0 0 0 15px rgba(251,191,36,0); } 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); } }
@keyframes spinSlow { 100% { transform: rotate(360deg); } }

.fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.pulse-btn { animation: pulseGlow 2s infinite; border-radius: 12px; }
.pulse-glow { animation: pulseGlow 2s infinite; border-radius: 50%; }
.spinning-slow { animation: spinSlow 3s linear infinite; }

/* Cards & Buttons */
.bok-card { background: rgba(255,255,255,0.03); backdrop-filter: blur(24px) saturate(180%); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05); transition: all 0.4s; }

.bok-btn { padding: 10px 20px; border-radius: 12px; font-weight: 700; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.3s; border: none; text-transform: uppercase; font-family: inherit; }
.bok-btn--primary { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3); } /* Gold theme for premium book */
.bok-btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5); }
.bok-btn-text { background: transparent; border: none; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: 0.2s; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.bok-btn-text:hover { filter: brightness(1.2); }
.bok-btn-icon-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.bok-btn-icon-small:hover { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: #fbbf24; }

.bok-input, .bok-select { width: 100%; padding: 10px 14px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px; transition: 0.3s; font-family: inherit; font-size: 0.85rem; outline: none; }
.bok-input:focus, .bok-select:focus { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,0.2); }
.bok-form-group { margin-bottom: 16px; }
.bok-form-group label { display: block; margin-bottom: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.7); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.bok-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.bok-color-picker { -webkit-appearance: none; width: 100%; height: 36px; border: none; border-radius: 8px; cursor: pointer; padding: 0; background: transparent; }
.bok-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.bok-color-picker::-webkit-color-swatch { border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; }

/* Header */
.bok-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 24px; flex-shrink: 0; }
.bok-header__title { font-size: 2.2rem; font-weight: 800; margin: 0 0 8px 0; letter-spacing: 1px; }
.bok-header__subtitle { color: #fbbf24; margin: 0; font-size: 1rem; }

/* Config Lists & Toggles */
.bok-template-grid { display: flex; gap: 8px; }
.bok-tpl-btn { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); text-align: center; padding: 8px 4px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: 0.2s; color: rgba(255,255,255,0.6); }
.bok-tpl-btn:hover { color: white; background: rgba(255,255,255,0.05); }
.bok-tpl-btn.active { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: #fbbf24; }

.bok-sections-list { display: flex; flex-direction: column; gap: 8px; }
.bok-sec-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); transition: 0.2s; }
.bok-sec-item:hover { background: rgba(255,255,255,0.05); }

.bok-chk-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.85rem; color: rgba(255,255,255,0.9); flex-grow: 1; }
.bok-chk-row input { accent-color: #fbbf24; width: 16px; height: 16px; cursor: pointer; }

/* 3D BOOK PREVIEW */
.bok-book-scene { perspective: 1200px; width: 100%; max-width: 800px; display: flex; justify-content: center; margin: 0 auto; }

/* Cover (Leather Hardcover style) */
.bok-cover-render { width: 450px; height: 600px; position: relative; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); transform: rotateY(-10deg) rotateX(5deg); transform-origin: left center; }
.bok-cover-render:hover { transform: rotateY(-5deg) rotateX(2deg); cursor: pointer; }

.bok-cover-texture { width: 100%; height: 100%; border-radius: 4px 16px 16px 4px; box-shadow: inset 4px 0 10px rgba(0,0,0,0.5), inset -1px 0 2px rgba(255,255,255,0.2), 10px 20px 40px rgba(0,0,0,0.5); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Leather texture mock using multiple gradients */
.bok-cover-texture::before { content:''; position:absolute; top:0; left:0; width:100%; height:100%; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23n)" opacity="0.1"/></svg>'); mix-blend-mode: multiply; pointer-events: none; }

.bok-spine { position: absolute; top: 0; left: 0; width: 15px; height: 100%; background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(0,0,0,0.4) 5px, rgba(255,255,255,0.1) 10px, rgba(0,0,0,0.4) 15px); }

.bok-cover-content { position: relative; z-index: 2; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; box-sizing: border-box; }

/* Foil Text Effect */
.foil-gold { background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c); -webkit-background-clip: text; color: transparent; text-shadow: 1px 1px 2px rgba(0,0,0,0.5), -1px -1px 1px rgba(255,255,255,0.3); }
.foil-silver { background: linear-gradient(to right, #8a8a8a, #c0c0c0, #e8e8e8, #c0c0c0, #8a8a8a); -webkit-background-clip: text; color: transparent; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.foil-rose { background: linear-gradient(to right, #b76e79, #e0bfb8, #c07c88, #e0bfb8, #b76e79); -webkit-background-clip: text; color: transparent; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.foil-none { color: rgba(255,255,255,0.8); text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

.bok-c-title { font-family: 'Times New Roman', serif; font-size: 3rem; line-height: 1.1; margin: 0 0 16px 0; text-transform: uppercase; letter-spacing: 2px; }
.bok-c-sub { font-size: 1.1rem; letter-spacing: 1px; font-weight: 600; margin: 0; }
.bok-c-year { font-size: 6rem; font-weight: 900; margin: 40px 0; font-family: 'Inter', sans-serif; letter-spacing: -2px; }
.bok-c-auth { font-size: 1.2rem; margin: auto 0 0 0; letter-spacing: 2px; font-weight: 400; text-transform: uppercase; }
.bok-c-logo { position: absolute; top: 32px; font-size: 1.5rem; font-weight: 800; font-family: 'Inter'; border: 2px solid; padding: 4px 8px; border-radius: 4px; }

/* Spread View (Inside Pages) */
.bok-spread-render { display: flex; width: 900px; height: 600px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); position: relative; background: #fff; border-radius: 4px; animation: popIn 0.5s ease-out; }
.bok-page { flex: 1; background: #fdfbf7; /* paper color */ padding: 40px; box-sizing: border-box; color: #1a1a1a; position: relative; overflow: hidden; }
.left-page { border-right: 1px solid rgba(0,0,0,0.1); }
.right-page { border-left: 1px solid rgba(0,0,0,0.05); }
.bok-binding { position: absolute; left: 50%; top: 0; width: 40px; height: 100%; transform: translateX(-50%); background: linear-gradient(to right, transparent, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 60%, transparent); pointer-events: none; z-index: 10; }

/* Inner Page Typo & Layout (Mocks for rendered content) */
.p-hdr { font-size: 0.6rem; color: #999; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 32px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.p-title { font-family: 'Times New Roman', serif; font-size: 2.2rem; color: #111; margin: 0 0 24px 0; }
.p-txt { font-size: 0.95rem; line-height: 1.7; color: #333; margin-bottom: 16px; text-align: justify; }
.p-quote { font-family: 'Times New Roman', serif; font-style: italic; font-size: 1.5rem; line-height: 1.4; text-align: center; color: #555; margin: 60px 20px; }
.p-chart-box { width: 100%; height: 250px; border: 1px solid #eaeaea; margin: 24px 0; background: #fff; }
.p-num { font-size: 3rem; font-weight: 900; color: #111; letter-spacing: -1px; line-height: 1; font-family: 'Inter', sans-serif; margin-bottom: 4px; }
.p-num-lbl { font-size: 0.7rem; text-transform: uppercase; color: #666; font-weight: 700; letter-spacing: 1px; }

/* Thumbnails */
.bok-thumbnails-strip { display: flex; gap: 12px; overflow-x: auto; max-width: 900px; padding-bottom: 16px; scrollbar-width: none; }
.bok-thumb { width: 60px; height: 80px; background: #fff; border-radius: 4px; border: 2px solid transparent; cursor: pointer; transition: 0.2s; opacity: 0.6; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #999; font-weight: 700; }
.bok-thumb:hover, .bok-thumb.active { opacity: 1; border-color: #fbbf24; }
.bok-thumb.t-cover { background: #1a0f0a; color: #fbbf24; }

/* Dropzone & Modals */
.bok-dropzone { border: 2px dashed rgba(251,191,36,0.4); border-radius: 16px; padding: 32px; text-align: center; background: rgba(251,191,36,0.05); transition: 0.3s; cursor: pointer; }
.bok-dropzone:hover { border-color: #fbbf24; background: rgba(251,191,36,0.1); }
.bok-gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow-y: auto; padding-right: 8px; }
.g-item { aspect-ratio: 1; background: rgba(255,255,255,0.1); border-radius: 8px; position: relative; overflow: hidden; }
.g-item img { width: 100%; height: 100%; object-fit: cover; }
.g-item-del { position: absolute; top:4px; right:4px; background: rgba(0,0,0,0.5); color: #fff; border:none; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }

.bok-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.bok-modal__overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.bok-modal__content { position: relative; background: #0d0b12; border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; width: 90%; max-height: 90vh; padding: 32px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.bok-modal__close { position: absolute; top: 24px; right: 24px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.5rem; cursor: pointer; transition: 0.3s; z-index: 10; }
.bok-modal__close:hover { color: white; }

.bok-giant-icon { font-size: 4rem; display: inline-block; }
.bok-progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin: 0 auto; }
.bok-progress-fill { height: 100%; border-radius: 4px; transition: width 0.2s linear; }

/* Page Renders */
.svg-chart-full { width: 100%; height: 100%; }
.s-line { fill: none; stroke: #333; stroke-width: 2; stroke-linecap: round; }
.s-area { fill: #f3f4f6; }