/* IDPDF Public Styles */

/* --- SHARED VARIABLES --- */
:root {
    --idpdf-primary: #0073aa;
    --idpdf-primary-hover: #005a87;
    --idpdf-text-light: #ffffff;
    --idpdf-bg-light: #f0f0f1;
    --idpdf-border: #ddd;
    --idpdf-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --- DOWNLOAD BUTTON --- */
.idpdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #525659;
    color: var(--idpdf-text-light) !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid var(--idpdf-border);
    line-height: 1.5;
}

.idpdf-btn:hover {
    background-color: #323639;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: var(--idpdf-text-light) !important;
    text-decoration: none;
    border-color: #999;
}

.idpdf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #222;
}

.idpdf-btn svg {
    margin-right: 8px;
    fill: currentColor;
    width: 16px;
    height: 16px;
}

/* --- PDF VIEWER CONTAINER --- */
.idpdf-viewer-container {
    position: relative;
    background-color: #525659;
    border: 1px solid var(--idpdf-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--idpdf-shadow);
}

/* --- TOOLBAR --- */
.idpdf-viewer-toolbar {
    background: #323639;
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.idpdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.idpdf-toolbar-btn {
    background: transparent;
    border: none;
    color: #f1f1f1;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.idpdf-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.idpdf-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.idpdf-toolbar-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.idpdf-page-info {
    font-size: 13px;
    color: #ddd;
    font-family: monospace;
}

/* --- CANVAS AREA --- */
.idpdf-canvas-wrapper {
    flex: 1;
    overflow: auto;
    background: #525659;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

/* Specific adjustments for Flipbook View to remove space */
.idpdf-viewer-container[data-view="flipbook"] .idpdf-canvas-wrapper {
    padding: 0;
    overflow: hidden;
    align-items: center;
}

.idpdf-canvas-wrapper canvas,
.idpdf-flip-page canvas {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: white;
    max-width: 100%;
    height: auto;
}

.idpdf-viewer-canvas-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* --- LOADING SPINNER --- */
.idpdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.idpdf-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- ERROR / LOGIN MESSAGE --- */
.idpdf-message-overlay {
    position: absolute;
    inset: 0;
    background: #f0f0f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    text-align: center;
    padding: 20px;
    color: #333;
}

.idpdf-message-overlay h3 {
    margin-top: 0;
}

/* --- FLIPBOOK STYLES --- */
.idpdf-flipbook-container {
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.idpdf-flip-page {
    background-color: #fff;
    overflow: hidden;
    /* Remove internal shadow that might look like "hover" weirdness */
}

.idpdf-page-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    /* Remove padding for tighter fit */
    box-sizing: border-box;
    background: white;
}

.idpdf-flip-page canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: none;
    /* Shadow handled by PageFlip library */
}

/* Responsive adjustments for flipbook */
@media (max-width: 768px) {
    .idpdf-flipbook-container {
        width: 100% !important;
    }
}