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

body {
    font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f5f7fa;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: none;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8f4f8;
}

.logo-section {
    flex-shrink: 0;
}

.logo {
    height: 60px;
    width: auto;
}

.title-section {
    flex-grow: 1;
    text-align: center;
}

h1 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.input-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e8f4f8;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input[type="text"]:focus {
    outline: none;
    border-color: #2943a8;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.Generate-btn {
    background: linear-gradient(45deg, #4548f8, #5768eb);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    display: block;
    margin: 0 auto;
    min-width: 200px;
}

.Generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 75, 177, 0.4);
}

.Generate-btn:active {
    transform: translateY(0);
}

.Generate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    display: none;
    text-align: center;
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e6ed;
    border-left: 4px solid #4156be;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-section {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e8f4f8;
}
.section {
    min-height: 100px;
    transition: background-color 0.2s;
}

.section.drag-over {
    background-color: #e3f2fd;
    border: 2px dashed #2196f3;
}

.drag-handle {
    cursor: grab;
    color: #666;
    font-size: 12px;
    line-height: 16px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}


.drag-handle:active {
    cursor: grabbing;
}

.output-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #4744da;
    padding-bottom: 10px;
}

.analysis-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border-left: 5px solid #355bb3;
    line-height: 1.8;
    font-size: 16px;
    color: #2c3e50;
    white-space: pre-wrap;
    font-family: 'Georgia', serif;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #e74c3c;
    margin: 20px 0;
    display: none;
}

.section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: #fafbfc;
}

.section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

/* .checkbox-item {
    cursor: move;
    display: flex;
    align-items: flex-start;
    margin-bottom: 7px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e8f4f8;
    transition: background-color 0.2s ease;
} */
.checkbox-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fafafa;
    gap: 8px;
    position: relative;
    min-width: 0;
}

.checkbox-item:hover {
    background: #f8f9fa;
}

.checkbox-item.dragging {
    opacity: 0.5;
}

/* .checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 4px;
    cursor: pointer;
} */

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    vertical-align: top;
    flex-shrink: 0;
    accent-color: #1c5f8a; 
}

.checkbox-item label {
    cursor: pointer;
    flex: 1;
    line-height: 1;
    font-size: 20px;
    margin-left: 4px;
}
.issue-text {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 6px;
    display: block;
    line-height: 1.5;
}

.description {
    font-size: 18px;        
    line-height: 1.6;
    margin-bottom: 4px;
}

.regulations {
    color: #7f8c8d;
    font-size: 17px;
    font-style: italic;
    margin-bottom: 4px;
    font-family: 'Times New Roman', Times, serif;
}

.reason {
    color: #e74c3c;
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    margin-left: 8px;
}

.badge.investigable {
    background: #d4edda;
    color: #155724;
}

.badge.non-investigable {
    background: #f8d7da;
    color: #721c24;
}

.other-item {
    flex-direction: column;
    align-items: flex-start;
    background: #f8f9ff;
}

.other-item:hover {
    background: #f0f4ff;
}

.other-input {
    width: calc(100% - 24px);
    margin-top: 8px;
    margin-left: 24px;
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: all 0.3s ease;
}

/* Override for new other-input-container format */
.other-input-container .other-input {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
}

.other-input:focus {
    outline: none;
    border-color: #eff9ff;
    box-shadow: 0 0 0 2px rgba(239, 242, 244, 0.1);
}

.other-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.other-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.select-all-btn, .deselect-all-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.select-all-btn:hover, .deselect-all-btn:hover {
    background: #27ae60;
}

.deselect-all-btn {
    background: #e74c3c;
}

.deselect-all-btn:hover {
    background: #c0392b;
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .select-all-btn, .deselect-all-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

.generate-action-btn {
    background: linear-gradient(45deg, #4548f8, #5768eb);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(69, 72, 248, 0.3);
    margin-left: auto;
}

.generate-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(69, 72, 248, 0.4);
}

.generate-action-btn:active {
    transform: translateY(0);
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

/* .checkbox-content {
    position: relative;
    flex: 1;
    margin-left: 25px;
} */

.checkbox-content {
    line-height: 1.6;       /* More breathing room between lines */
    gap: 6px;               /* More space between inner elements */
    display: flex;
    flex-direction: column;
    font-size: 18px;
    padding-right: 70px; /* Add padding to avoid overlap with edit-icon */
    flex: 1;
}


/* .edit-icon {
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
    font-size: 12px;         
    font-weight: 500;         
    color: #007bff;          
    padding: 4px 8px;        
    opacity: 1;
    transition: all 0.3s ease;
    text-decoration: underline; 
} */
.edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    color: #007bff;
    cursor: pointer;
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #007bff;
    z-index: 10;
}

.edit-icon:hover {
    opacity: 1;
    background-color: rgba(0, 123, 255, 0.1); 
    color: #0056b3;           
    border-radius: 3px;
}

.edit-content {
    display: none;
}

.edit-issue, .edit-description, .edit-regulations {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.edit-description, .edit-regulations {
    min-height: 60px;
    resize: vertical;
}

.edit-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.save-btn, .cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.save-btn {
    background-color: #28a745;
    color: white;
}

.save-btn:hover {
    background-color: #218838;
}

.cancel-btn {
    background-color: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

.section[data-category="resources"] {
    margin-top: 20px;
}
.section[data-category="resources"] h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}
.resource-text {
    display: block;
    margin: 5px 0;
}
.edit-resource {
    width: 100%;
    height: 60px;
    margin: 5px 0;
}

/* === MAYFLOWER STYLING ENHANCEMENTS === */

.checkbox-item label {
    font-size: 18px;
    font-weight: 500;
    color: #212121;
    line-height: 1.4;
}

.section h3 {
    font-size: 20px;
    color: #1c5f8a;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #a1c4db;
    padding-bottom: 4px;
}

.generate-dynamic-items-btn {
    background-color: #1c5f8a;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.generate-dynamic-items-btn:hover {
    background-color: #144766;
}

.generate-wrapper {
    margin-left: auto;
}
.admin-access-section {
    margin-left: auto;
    padding-left: 20px;
}

.admin-dashboard-btn {
    background: #144766;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background: #144869;
}

.admin-dashboard-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-dashboard-btn span {
    font-size: 16px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-access-section {
        margin-left: 0;
        padding-left: 0;
        align-self: flex-end;
    }
    
    .admin-dashboard-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}
input[type="file"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:focus {
    outline: none;
    border-color: #2943a8;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(45deg, #4548f8, #5768eb);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(45deg, #3b3ed6, #4a5ac9);
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #7f8c8d;
    font-style: italic;
}
.refresh-section {
    display: flex;
    justify-content: flex-end; /* Aligns button to the right */
    margin: 20px 0;
}

.refresh-btn {
    background: #e74c3c; /* Red for reset action */
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background: #c0392b;
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Add these styles to your existing styles.css */

.choice-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.choice-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.choice-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.choice-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.input-method-section {
    margin-bottom: 20px;
}

.other-checkbox-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.other-input-container {
    width: 100%;
    padding: 12px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 0;
    box-sizing: border-box;
}

.other-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.other-input-inline {
    flex: 1;
    min-width: 0;
}

.other-input-full {
    width: 100%;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.other-input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    max-width: 100%;
    resize: vertical;
}

/* Ensure textareas in other-input-container don't overflow */
.other-input-container .other-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
}

/* Additional specific rules for other allegation textareas */
.checkbox-item.other-item textarea,
.checkbox-item.other-item input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
}

.other-input:last-child {
    margin-bottom: 0;
}

.investigable-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    white-space: nowrap;
    margin: 0;
}

.investigable-toggle input[type="checkbox"] {
    margin: 0;
}

.checkbox-item.other-item {
    display: block !important;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex-direction: column !important;
    align-items: stretch !important;
}

.checkbox-item.other-item .checkbox-content {
    width: 100%;
    display: block;
    box-sizing: border-box;
    padding-right: 0 !important;
}

.checkbox-item.other-item .other-input-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.checkbox-item.other-item .other-input-container * {
    box-sizing: border-box;
}

.checkbox-item.other-item .other-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#statementText {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

#statementText:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

@media (max-width: 768px) {
    .refresh-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}
/* full-width page – makes life easier */
html, body { margin:0; width:100%; }

/* Flex row that contains both panes */
#viewerWrapper { display:flex; gap:16px; }

/* LEFT  ▸  PDF pane */
#pdfViewer {
  flex: 0 0 45%;       /* 45 % width, no growth  */
  max-width: 50%;      /* never exceed half the row */
  height: 92vh;        /* visible almost full-height */
  border: 1px solid #ccc;
  
  /* "sticky" magic: lock to top once scrolled there */
  position: sticky;
  top: 0;
}

/* RIGHT ▸  interactive panel */
#outputContainer {
  flex: 1 1 55%;       /* fills the rest of the row */
  height: 92vh;        /* match PDF viewer height */
  overflow-y: auto;    /* make this container scrollable */
  overflow-x: hidden;  /* prevent horizontal scroll */
}

/* =============================================================================
 * FONT SIZE ACCESSIBILITY CONTROLS
 * ============================================================================= */

/* Container for font size controls */
.font-size-controls {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.font-size-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.font-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.font-control-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #5cbf60 0%, #4fa652 100%);
}

.font-control-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.font-control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.font-control-icon {
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
}

.font-size-display {
    min-width: 40px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.font-reset-btn {
    padding: 4px 8px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-reset-btn:hover {
    background: #555;
    transform: translateY(-1px);
}

.font-reset-btn:active {
    transform: translateY(0);
}

/* Update refresh section to use flexbox for better alignment */
.refresh-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 5px;
}

/* Font scale feedback popup */
.font-size-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: fontFeedbackSlide 2s ease-out forwards;
}

@keyframes fontFeedbackSlide {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    15% {
        opacity: 1;
        transform: translateX(0);
    }
    85% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Font scaling system */
:root {
    --font-scale: 1.0;
}

/* Apply font scaling to all text elements when font-scaled class is present */
body.font-scaled h1 {
    font-size: calc(2.2em * var(--font-scale)) !important;
}

body.font-scaled h2 {
    font-size: calc(1.8em * var(--font-scale)) !important;
}

body.font-scaled h3 {
    font-size: calc(1.3em * var(--font-scale)) !important;
}

body.font-scaled p,
body.font-scaled div,
body.font-scaled span,
body.font-scaled button,
body.font-scaled input,
body.font-scaled textarea,
body.font-scaled label,
body.font-scaled td,
body.font-scaled th,
body.font-scaled li,
body.font-scaled a {
    font-size: calc(1em * var(--font-scale)) !important;
}

/* Specific overrides for elements that should maintain relative sizing */
body.font-scaled .font-size-display,
body.font-scaled .font-control-btn,
body.font-scaled .font-reset-btn {
    font-size: calc(12px * var(--font-scale)) !important;
}

/* Help Button */
:root {
    --mayflower-blue: #003f7f;
    --mayflower-blue-light: #0066cc;
    --mayflower-blue-dark: #002952;
    --mayflower-blue-hover: #004080;
    --white: #ffffff;
    --light-gray: #f8f9fa;
}

/* Adjust header layout to accommodate help button */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--light-gray) 0%, #e8f4fd 100%);
    border-bottom: 2px solid var(--mayflower-blue);
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    flex: 0 0 auto;
}

.title-section {
    flex: 1 1 auto;
    text-align: center;
    min-width: 200px;
}

.admin-access-section {
    flex: 0 0 auto;
}

.help-section {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Help Button Styles */
.help-btn {
    background: var(--mayflower-blue);
    color: var(--white);
    border: 2px solid var(--mayflower-blue);
    border-radius: 50px;
    padding: 10px 18px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 63, 127, 0.2);
    min-width: 80px;
    justify-content: center;
}

.help-btn:hover {
    background: var(--mayflower-blue-hover);
    border-color: var(--mayflower-blue-hover);
    box-shadow: 0 4px 12px rgba(0, 63, 127, 0.3);
    transform: translateY(-2px);
}

.help-btn:active {
    background: var(--mayflower-blue-dark);
    border-color: var(--mayflower-blue-dark);
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 63, 127, 0.2);
}

.help-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3), 0 2px 8px rgba(0, 63, 127, 0.2);
}

/* Help Icon Styles */
.help-icon {
    background: var(--white);
    color: var(--mayflower-blue);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.help-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .title-section {
        order: 1;
    }
    
    .logo-section {
        order: 2;
    }
    
    .help-section {
        order: 3;
    }
    
    .admin-access-section {
        order: 4;
    }
    
    .help-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .help-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }
    
    .help-btn {
        padding: 6px 14px;
        font-size: 12px;
        gap: 6px;
    }
    
    .help-text {
        display: none;
    }
    
    .help-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Animation for smooth interactions */
@keyframes helpButtonPulse {
    0% {
        box-shadow: 0 2px 8px rgba(0, 63, 127, 0.2);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 63, 127, 0.4);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 63, 127, 0.2);
    }
}

.help-btn.pulse {
    animation: helpButtonPulse 1.5s ease-in-out infinite;
}

/* Logout Button */
.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

body.font-scaled .refresh-btn {
    font-size: calc(1.1em * var(--font-scale)) !important;
}

/* S3 Browser Styles */
.s3-browse-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.s3-browse-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.s3-browser {
    position: fixed;
    top: 5%;
    left: 5%;
    width: 90vw;
    height: 85vh;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.s3-browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.s3-browser-header span {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.s3-browser-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.s3-file-list {
    width: 40%;
    padding: 16px;
    overflow-y: auto;
    border-right: 1px solid #e9ecef;
    max-height: calc(85vh - 80px);
    box-sizing: border-box;
}

.s3-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.s3-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.s3-item.folder {
    color: #495057;
    border-left: 4px solid #007bff;
}

.s3-item.file.valid {
    color: #28a745;
    border-left: 4px solid #28a745;
}

.s3-item.file.invalid {
    color: #6c757d;
    border-left: 4px solid #6c757d;
}

.file-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.file-badge.valid {
    background: #d4edda;
    color: #155724;
}

.file-badge.invalid {
    background: #f8d7da;
    color: #721c24;
}

.s3-file-viewer {
    width: 60%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.file-viewer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.redact-file-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.redact-file-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.redact-file-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.redact-text-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.redact-text-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.redact-text-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.text-input-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.redaction-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.redaction-summary {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.redaction-status.success .redaction-summary {
    color: #28a745;
}

.redaction-status.warning .redaction-summary {
    color: #ffc107;
}

.restore-text-btn {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    margin-left: 8px !important;
    transition: background 0.3s ease !important;
}

.restore-text-btn:hover {
    background: #5a6268 !important;
}

.file-viewer-header span {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.select-file-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.select-file-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.file-content {
    flex: 1;
    margin: 0;
    padding: 16px;
    background: white;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    line-height: 1.4;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: calc(85vh - 140px);
    box-sizing: border-box;
}

/* S3 Case Details Styling */
.case-detail-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.case-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.case-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.case-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.case-detail-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-detail-value {
    color: #212529;
    font-size: 14px;
    font-weight: 500;
}

.case-status-badge {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    width: fit-content;
}

.statement-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.statement-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    color: #495057;
}

@media (max-width: 768px) {
    .case-detail-grid {
        grid-template-columns: 1fr;
    }
}

.loading-files, .error-files, .no-files {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.redacted-statement-section {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.redacted-statement-header {
    margin: 0 0 15px 0;
    color: #155724;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.redacted-statement-content {
    background: white;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 14px;
    color: #495057;
}

.redaction-summary {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #6c757d;
}

.error-files {
    color: #dc3545;
}

.additional-fields-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.additional-fields-header {
    margin: 0 0 15px 0;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* Responsive adjustments for font scaling */
@media (max-width: 768px) {
    .font-size-wrapper {
        gap: 6px;
        padding: 4px 8px;
    }
    
    .font-control-btn {
        width: 24px;
        height: 24px;
    }
    
    .font-control-icon {
        font-size: 14px;
    }
    
    .font-size-display {
        min-width: 35px;
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .font-reset-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .font-size-feedback {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .refresh-section {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .font-size-controls {
        order: -1; /* Put font controls first on mobile */
    }
}
