/* style.css */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  /* Removed fixed height and centering for scrollable content */
  margin: 0;
  color: #333333;
  padding-top: 20px; /* Add some padding at the top */
  padding-bottom: 20px; /* Add some padding at the bottom for long pages */
}

.container, .login-container {
  background-color: #ffffff;
  padding: 30px; /* Adjusted padding */
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  /* width: 320px;  Let .container in upload.html manage its width */
  text-align: left; /* Changed from center for upload page */
  margin: 0 auto; /* Center the container itself */
}
.login-container { /* Keep login container specific styles */
    width: 320px; 
    text-align: center;
    margin-top: 10vh; /* Position login box nicely */
}


h2 {
  margin-top: 0; 
  margin-bottom: 24px;
  color: #333333;
  text-align: center; /* Center h2 specifically */
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

button, input[type="submit"] { 
  width: 100%;
  padding: 12px;
  background-color: #4e54c8;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-sizing: border-box;
}

/* For buttons not meant to be full-width like upload and logout */
#uploadButton, .logout-btn {
    width: auto; /* Override full width */
    align-self: flex-start; /* For #uploadButton if in a flex container */
}
#uploadButton { /* Specific for upload button if needed */
    padding: 8px 16px; 
}


button:hover, input[type="submit"]:hover {
  background-color: #3b40a4;
}

button:disabled, input[type="submit"]:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.message, .error-message {
  font-size: 14px;
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 4px;
  display: none; 
}

.error-message.active, .message.active, .message.error, .message.success, .message.info { /* Simplified */
    display: block; 
}

.error, .error-message, .message.error { /* Ensure .message.error inherits base error styles */
  color: #D8000C;
  background-color: #FFD2D2;
  border: 1px solid #D8000C;
}

.success, .message.success { /* Ensure .message.success inherits base success styles */
  color: #4F8A10;
  background-color: #DFF2BF;
  border: 1px solid #4F8A10;
}

.message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* User info section (already good) */
.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.username {
  font-weight: bold;
  color: #4e54c8;
}

.logout-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  width: auto; 
}

.logout-btn:hover {
  background-color: #c82333;
}

/* Styles for new preview elements - many are inline for specificity but can be moved here */
#file-preview-area {
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 15px; /* Reduced from 20px to match section gap */
    background-color: #f9f9f9;
    border-radius: 8px;
}
#pdf-preview-canvas {
    border: 1px solid #ccc;
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below */
    margin-bottom: 10px;
}
#xml-preview-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #efefef;
    padding: 10px;
    border-radius: 4px;
    max-height: 400px;
    overflow: auto;
    font-family: monospace;
}
#ocr-output-container {
    margin-top: 15px;
}
#ocr-output-container h4 {
    margin-bottom: 5px;
    color: #333;
}
#ocr-output {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #e9f5ff;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #bde0fe;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95em;
    line-height: 1.6;
}
#ocr-status-container {
    margin-top: 10px;
}
#ocr-status {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}
#ocr-progress-container {
    font-size: 0.9em;
    color: #555;
}
#ocr-progress {
    width: 100%;
    height: 10px;
    border-radius: 5px;
}
#ocr-progress::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 5px;
}
#ocr-progress::-webkit-progress-value {
    background-color: #4e54c8;
    border-radius: 5px;
    transition: width 0.2s ease-in-out;
}
#ocr-progress::-moz-progress-bar { /* Firefox */
    background-color: #4e54c8;
    border-radius: 5px;
    transition: width 0.2s ease-in-out;
}