/* static/styles.css */

/* --- Base & Main Page Styles (Your Original Styles) --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}
header { text-align: center; margin-bottom: 40px; }
h1 { color: #2c3e50; }
main { max-width: 800px; margin: 0 auto; }
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}
input[type="file"] { margin-right: 10px; }
button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
button:hover { background-color: #2980b9; }
button:active { transform: translateY(1px); }

/* --- Job List (Your Original Styles) --- */
#job-list { list-style: none; padding: 0; }
#job-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}
#job-list li:last-child { border-bottom: none; }
.status {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    background-color: #ecf0f1;
    color: #7f8c8d;
}
.status[data-status="done"] { background-color: #e8f5e9; color: #2e7d32; }
.status[data-status="failed"] { background-color: #ffcdd2; color: #c62828; }
.play-btn { background-color: #2ecc71; }
.play-btn:hover { background-color: #27ae60; }
.job-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.delete-btn {
    background-color: transparent;
    border: none;
    color: #95a5a6;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}
.delete-btn:hover { color: #c0392b; }

/* --- Progress Bar (Your Original Styles) --- */
.progress-container { display: flex; align-items: center; gap: 0.5rem; }
progress[indeterminate] {
    background-image: linear-gradient(to right, #3498db 30%, #ecf0f1 30%);
    background-size: 200% 100%;
    animation: indeterminate-progress 1.2s linear infinite;
}
@keyframes indeterminate-progress {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}


.modal {
    /* display: none; is handled by JS */
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Darker overlay */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #2b2b2b; /* Dark theme for viewer */
    width: 100%;
    height: 100%;
    margin: 0; /* Remove margin for full screen */
    padding: 0; /* Remove padding */
    border: none; /* Remove border */
    border-radius: 0; /* No radius for full screen */
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden; /* Critical for layout */
}

.viewer-body {
    flex-grow: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    min-height: 0;
}

#image-container {
    position: relative;
    width: 100%;   /* Take full width of the padded viewer-body */
    height: 100%;  /* Take full height of the padded viewer-body */
    display: flex;
    justify-content: center;
    align-items: center;
}

#page-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#highlight-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.viewer-controls {
    display: flex;
    flex-direction: column; /* Stack playback bar on top of main controls */
    padding: 0.75rem 1.5rem;
    background-color: #1e1e1e;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3); /* Shadow on top */
}

/* NEW: Playback Bar for the slider */
.playback-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.75rem;
}

#current-time, #total-time {
    font-size: 0.9rem;
    color: #ccc;
    min-width: 40px; /* Prevent layout shifts */
    text-align: center;
}

/* NEW: Styling for the progress slider */
#progress-slider {
    flex-grow: 1;
    -webkit-appearance: none; /* Override default look */
    appearance: none;
    width: 100%;
    height: 5px;
    background: #444;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

/* Thumb (the draggable handle) for Webkit browsers */
#progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #3498db; /* Your theme color */
    border-radius: 50%;
    border: 2px solid #1e1e1e;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    transition: background 0.2s ease;
}
#progress-slider::-webkit-slider-thumb:hover {
    background: #5dade2;
}

/* Thumb for Firefox */
#progress-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3498db;
    border-radius: 50%;
    border: 2px solid #1e1e1e;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    cursor: pointer;
}

/* NEW: Wrapper for the main buttons */
.main-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-controls button {
    background: none;
    border: 1px solid #555;
    color: #eee;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.main-controls button:hover:not(:disabled) {
    background-color: #333;
    border-color: #777;
}

.main-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: transparent;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#play-pause-btn {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-color: #3498db;
}

#page-indicator {
    font-size: 1.1rem;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: white;
}
