﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
}

#mainContainer {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #2c3e50;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

    .control-btn:hover {
        background: #4a6741;
    }

    .control-btn:disabled {
        background: #7f8c8d;
        cursor: not-allowed;
    }

.page-input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.page-info {
    font-size: 14px;
    color: #ecf0f1;
}

#viewerContainer {
    flex: 1;
    overflow: auto;
    background: #ecf0f1;
    position: relative;
}

#viewer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pdf-page {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.pdf-page-placeholder {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    font-size: 14px;
}

.pdf-page::before {
    content: "Page " attr(data-page-number);
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1;
}

.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
}

    .textLayer > span {
        color: transparent;
        position: absolute;
        white-space: pre;
        cursor: text;
        transform-origin: 0% 0%;
    }

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

#loadingIndicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

    #loadingIndicator.visible {
        display: flex;
    }

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #7f8c8d;
}

@media (max-width: 768px) {
    .header-controls {
        padding: 8px 10px;
        flex-direction: column;
        gap: 8px;
    }

    .control-group {
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-btn {
        padding: 10px 14px;
        font-size: 16px;
    }

    #viewer {
        padding: 10px;
    }

    .pdf-page::before {
        font-size: 14px;
        padding: 6px 10px;
    }
}

#mainContainer:fullscreen {
    background: black;
}

    #mainContainer:fullscreen #viewerContainer {
        background: #2c2c2c;
    }

    #mainContainer:fullscreen .pdf-page {
        box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
    }
