/* HIMSR PDF Flipbook - Styles */
:root {
    --fb-accent: #1a5632;
    --fb-accent-light: #e8f5e9;
    --fb-dark: #0d1b2a;
    --fb-text: #333;
    --fb-border: #e0e0e0;
    --fb-radius: 10px;
    --fb-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --fb-transition: 0.3s ease;
}

/* ===== TRIGGER STYLES ===== */

/* Card Style */
.fb-card {
    display: inline-block; width: 100%; max-width: 340px; margin: 8px 0;
}
.fb-card-inner {
    display: flex; align-items: center; gap: 16px; padding: 18px 20px;
    background: #fff; border: 1px solid var(--fb-border); border-radius: var(--fb-radius);
    cursor: pointer; transition: all var(--fb-transition); text-decoration: none !important;
}
.fb-card-inner:hover {
    border-color: var(--fb-accent); box-shadow: var(--fb-shadow);
    transform: translateY(-2px);
}
.fb-card-icon {
    width: 52px; height: 52px; border-radius: 12px;
    background: var(--fb-accent-light); color: var(--fb-accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all var(--fb-transition);
}
.fb-card-inner:hover .fb-card-icon {
    background: var(--fb-accent); color: #fff;
}
.fb-card-title {
    font-size: 15px; font-weight: 600; color: var(--fb-text);
    margin: 0 0 4px; line-height: 1.3;
}
.fb-card-action {
    font-size: 12px; color: var(--fb-accent); font-weight: 500;
    display: flex; align-items: center; gap: 4px;
    transition: gap var(--fb-transition);
}
.fb-card-inner:hover .fb-card-action { gap: 8px; }

/* Button Style */
.fb-trigger-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--fb-accent); color: #fff; border: none;
    padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all var(--fb-transition); font-family: inherit;
}
.fb-trigger-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: var(--fb-shadow); }
.fb-trigger-btn svg { stroke: #fff; }

/* Link Style */
.fb-trigger-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--fb-accent) !important; font-weight: 600; font-size: 15px;
    text-decoration: none !important; cursor: pointer;
}
.fb-trigger-link:hover { text-decoration: underline !important; }
.fb-trigger-link svg { stroke: var(--fb-accent); width: 18px; height: 18px; }

/* ===== MODAL ===== */
.fb-modal {
    position: fixed; inset: 0; z-index: 999999;
    display: flex; align-items: center; justify-content: center;
}
.fb-modal-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px); cursor: pointer;
}
.fb-modal-container {
    position: relative; z-index: 1;
    width: 95vw; height: 92vh; max-width: 1200px;
    background: #1a1a2e; border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* Header */
.fb-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; background: #0d1b2a;
    border-bottom: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
.fb-modal-title {
    color: #fff; font-size: 16px; font-weight: 600; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%;
}
.fb-modal-controls { display: flex; align-items: center; gap: 4px; }
.fb-control-btn {
    background: transparent; border: none; color: rgba(255,255,255,0.6);
    padding: 8px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.fb-control-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.fb-close-btn:hover { background: rgba(220,53,69,0.3); color: #ff6b6b; }
.fb-zoom-level { color: rgba(255,255,255,0.5); font-size: 12px; min-width: 40px; text-align: center; }
.fb-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.15); margin: 0 4px; }

/* Body */
.fb-modal-body {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #1a1a2e 0%, #12121e 100%);
}

/* Loading */
.fb-loading {
    text-align: center; color: rgba(255,255,255,0.6);
}
.fb-spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--fb-accent); border-radius: 50%;
    animation: fb-spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-loading-progress { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 4px; }

/* Viewer */
.fb-viewer {
    display: none; width: 100%; height: 100%;
    align-items: center; justify-content: center; position: relative;
}
.fb-pages-container {
    display: flex; align-items: center; justify-content: center;
    width: calc(100% - 100px); height: 100%; overflow: hidden;
}
.fb-flipbook {
    position: relative;
}
.fb-flipbook canvas, .fb-flipbook .fb-page {
    display: block;
}
.fb-page {
    background: #fff; overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}
.fb-page canvas {
    width: 100% !important; height: 100% !important;
}

/* Navigation arrows */
.fb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
    border: none; width: 44px; height: 80px; border-radius: 8px;
    font-size: 28px; cursor: pointer; transition: all 0.2s; z-index: 10;
}
.fb-nav:hover { background: rgba(255,255,255,0.15); color: #fff; }
.fb-nav-prev { left: 8px; }
.fb-nav-next { right: 8px; }

/* Footer */
.fb-modal-footer {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 20px; background: #0d1b2a;
    border-top: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
.fb-page-btn {
    background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6);
    padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px;
    transition: all 0.2s;
}
.fb-page-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.fb-page-info { color: rgba(255,255,255,0.6); font-size: 14px; }
.fb-page-input {
    width: 48px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: #fff; text-align: center; padding: 4px; border-radius: 4px; font-size: 14px;
    font-family: inherit;
}
.fb-page-input:focus { outline: none; border-color: var(--fb-accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .fb-modal-container { width: 100vw; height: 100vh; border-radius: 0; }
    .fb-modal-title { font-size: 14px; max-width: 30%; }
    .fb-nav { width: 36px; height: 60px; font-size: 22px; }
    .fb-pages-container { width: calc(100% - 80px); }
    .fb-card { max-width: 100%; }
}
