/* General Body and Font Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    /* Light gray background */
    color: #333;
    /* display: flex; */
    justify-content: center;
    align-items: flex-start;
    /* Align to top to avoid pushing content off screen on smaller devices */
    min-height: 100vh;
    /* Minimum full height */
    margin: 0;
    /* padding: 20px; */
    /* Padding around the container */
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    /* Wider for side-by-side comparison */
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-top: 50px;
    /* Space from the top */
    margin-bottom: 50px;
    /* Space from the bottom */
}

/* Headings */
h1 {
    color: #009999;
    /* Siemens blue-green */
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
}

.tagline {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* Upload Sections */
.upload-sections {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens */
}

.drop-area {
    flex: 1;
    /* Allows areas to grow and shrink */
    min-width: 300px;
    /* Minimum width for each drop area */
    border: 3px dashed #b0e0e6;
    /* Lighter Siemens blue-green */
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    background-color: #faffff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-area:hover,
.drop-area.highlight {
    border-color: #009999;
    background-color: #e6f7f7;
    /* Lighter hover background */
}

.drop-area p {
    font-size: 1em;
    color: #555;
    margin-bottom: 15px;
}

/* Upload Button (linked to input) */
.upload-button {
    display: inline-block;
    background-color: #009999;
    /* Siemens blue-green */
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 153, 153, 0.3);
    border: none;
    /* Remove default button border */
}

.upload-button:hover {
    background-color: #007a7a;
    /* Darker Siemens blue-green on hover */
    transform: translateY(-2px);
}

.upload-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 153, 153, 0.4);
}

.file-name {
    font-weight: 600;
    color: #007a7a;
    margin-top: 15px;
    font-size: 0.9em;
    word-wrap: break-word;
    /* Ensure long file names wrap */
}

/* Controls Area */
.controls-area {
    background-color: #e6f7f7;
    /* Light background for status */
    border: 1px solid #b0e0e6;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
    transition: opacity 0.3s ease, height 0.3s ease;
    overflow: hidden;
    /* Hide overflow when animating height */
}

.controls-area.hidden {
    opacity: 0;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: none;
    margin-bottom: 0;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #555;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px 12px;
    border: 1px solid #b0e0e6;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
}

#overlay-opacity-input {
    width: 150px;
}

#overlay-opacity-value {
    min-width: 40px;
    text-align: left;
    color: #007a7a;
    font-weight: 600;
}

.navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

#page-indicator {
    font-size: 1.1em;
    font-weight: 600;
    color: #007a7a;
    min-width: 100px;
}


/* Action Buttons */
.action-button {
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
    display: inline-block;
    /* For side-by-side buttons */
    margin: 0 5px;
    /* Spacing between buttons */
}

.primary-button {
    background-color: #009999;
    /* Siemens blue-green */
    color: white;
}

.primary-button:hover:not(:disabled) {
    background-color: #007a7a;
    /* Darker Siemens blue-green on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 153, 153, 0.4);
}

.secondary-button {
    background-color: #f8f8f8;
    /* Light gray */
    color: #555;
    border: 1px solid #ddd;
}

.secondary-button:hover:not(:disabled) {
    background-color: #eaeaea;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.action-button.hidden {
    display: none;
}

/* Status Message */
.status-message {
    font-size: 1em;
    color: #444;
    margin-top: 20px;
    text-align: center;
    min-height: 20px;
    /* Reserve space */
}

.status-message.error {
    color: #d9534f;
    /* Red for errors */
    font-weight: 600;
}

.status-message.success {
    color: #5cb85c;
    /* Green for success */
    font-weight: 600;
}

.status-message.info {
    color: #007a7a;
    /* Info blue-green */
}

.hidden {
    display: none !important;
}

/* Comparison Viewer */
.comparison-viewer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align content to top within panes */
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    /* Allow panes to wrap on smaller screens */
}

.pdf-viewer-pane {
    flex: 1;
    /* Allow panes to grow and shrink */
    min-width: 300px;
    /* Minimum width for each pane */
    background-color: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-viewer-pane h3 {
    color: #007a7a;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.pdf-canvas {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    width: 100%;
    /* Make canvas responsive within its pane */
    height: auto;
    /* Maintain aspect ratio */
    display: block;
    /* Remove extra space below canvas */
}

/* Specific styles for overlay mode */
#overlay-pane {
    position: relative;
    max-width: 600px;
    /* Limit width for single overlay pane */
    flex: none;
    /* Do not grow/shrink in overlay mode */
}

#pdf-canvas-overlay,
#diff-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

#pdf-canvas-overlay {
    opacity: 0.5;
    /* Default opacity for the top layer in overlay mode */
    z-index: 2;
    /* Ensure it's above the base PDF */
}

#diff-canvas {
    z-index: 3;
    /* Ensure diff highlights are on top */
}


/* Responsive adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 30px;
    }

    .comparison-viewer {
        flex-direction: column;
        /* Stack panes vertically on smaller desktops */
    }

    .pdf-viewer-pane {
        width: 100%;
        /* Full width when stacked */
        max-width: none;
    }

    #overlay-pane {
        max-width: 100%;
        /* Take full width when stacked */
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .tagline {
        font-size: 1em;
    }

    .upload-sections {
        flex-direction: column;
        gap: 15px;
    }

    .drop-area {
        min-width: auto;
        width: 100%;
        padding: 25px 15px;
    }

    .controls-area {
        padding: 20px;
    }

    .control-group {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .control-group label {
        width: 100%;
        text-align: center;
    }

    .control-group select,
    .control-group input[type="range"] {
        width: 100%;
    }

    #overlay-opacity-input {
        width: 80%;
        /* Adjust width for mobile slider */
    }

    .action-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .navigation-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    #page-indicator {
        order: -1;
        /* Move page indicator to top row if wrapped */
        margin-bottom: 10px;
        width: 100%;
    }
}