/* Preview Modal Styles */
.preview-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.preview-modal .hoa-modal-content {
    position: relative;
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Modal Header */
.preview-modal .hoa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.preview-title {
    margin: 0;
    font-size: 1.2em;
    color: #1d2327;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

.preview-controls button {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #50575e;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.preview-controls button:hover {
    background: #f0f0f1;
    color: #2271b1;
}

/* Modal Body */
.preview-modal .hoa-modal-body {
    position: relative;
    height: calc(100% - 120px);
    overflow: auto;
    padding: 20px;
    background: #f0f0f1;
}

/* Add to your plugin's CSS file */
.office-preview-container {
    position: relative;
    width: 100%;
    padding-bottom: 129.4%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.pdf-preview-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 4px;
}

.text-preview-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
}

#document-viewer {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

#document-viewer img,
#document-viewer canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#document-viewer pre.text-preview {
    width: 100%;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    white-space: pre-wrap;
    font-family: monospace;
}

#document-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    border-radius: 4px;
}

/* Preview Loader */
.preview-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.preview-loader .spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.preview-loader p {
    margin-top: 10px;
    color: #50575e;
}

/* Preview Error */
.preview-error {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-error .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #dc3232;
}

.preview-error .error-message {
    margin-top: 10px;
    color: #50575e;
}

/* Modal Footer */
.preview-modal .hoa-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
}

.preview-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.preview-navigation button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-navigation button:not(:disabled):hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.preview-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preview-count {
    color: #50575e;
    font-size: 0.9em;
}

.pdf-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: #f5f5f5;
}

.pdf-controls {
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pdf-control {
    background: none;
    border: none;
    padding: 5px;
    margin: 0 2px;
    cursor: pointer;
    color: #444;
}

.pdf-control:hover {
    color: #000;
}

.pdf-container {
    width: 100%;
    height: 100%;
    min-height: 600px;
    overflow: auto;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.pdf-container canvas {
    display: inline-block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pdf-page-controls {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
}

.pdf-page-info {
    margin: 0 10px;
    font-size: 14px;
    color: #444;
}

.pdf-control[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.txt-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: #f5f5f5;
}

.txt-controls {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.txt-controls-right {
    position: absolute;
    right: 10px;
    display: flex;
    gap: 10px;
}

.txt-control {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.txt-control:hover {
    background: #e0e0e0;
}

.txt-control.active {
    background: #007cba;
    color: #fff;
}

.txt-font-family {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.txt-container {
    padding: 20px;
    height: calc(100% - 60px);
    overflow: auto;
}

.txt-content {
    margin: 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    font-family: monospace;
    white-space: pre;
}

.txt-content.wrap-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Update for fullscreen mode */
.txt-preview-wrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    background: #fff;
}

.txt-preview-wrapper:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    background: #fff;
}

.txt-preview-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #fff;
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: #f5f5f5;
}

.image-controls {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.image-controls-right {
    position: absolute;
    right: 10px;
    display: flex;
    gap: 10px;
}

.image-control {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.image-control:hover {
    background: #e0e0e0;
}

.image-container {
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 60px 20px 20px 20px;
    position: relative;
    box-sizing: border-box;
    scroll-padding-top: 60px;
}

.preview-image {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    transition: transform 0.3s ease;
    transform-origin: center center;
    position: relative;
    object-fit: contain;
}

.image-transform-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, margin-top 0.3s ease;
}

/* Fullscreen styles */
.image-preview-wrapper:-webkit-full-screen,
.image-preview-wrapper:-ms-fullscreen,
.image-preview-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #fff;
}

.custom-office-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.custom-office-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.office-control {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

