/* CLASSIFIED DOCUMENT THEME */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #4a4a4a;
    color: #1a1a1a;
    overflow-x: hidden;
    padding: 40px 20px;
}

/* Main Document Container */
.document-container {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    background: #d4c5a0;
}

/* Content Area */
.content-area {
    background: #e8dfc4;
    position: relative;
    min-height: 1000px;
    border: 3px solid #8b7355;
}

/* Page Visibility */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* STICKY NOTES AS BOOKMARKS */
.sticky-notes {
    position: absolute;
    right: -3px;
    top: 80px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticky {
    width: 100px;
    height: 35px;
    background: #f4e5a3;
    border: 2px solid #c4b583;
    border-right: none;
    position: relative;
    cursor: pointer;
    box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 3px 0 0 3px;
}

.sticky:nth-child(1) {
    background: #f4e5a3;
}

.sticky:nth-child(2) {
    background: #f4dda3;
}

.sticky:nth-child(3) {
    background: #f4e8b3;
}

/* Numbered stickies alternate colors */
.sticky[id^="sticky-dossiers"]:not(#sticky-dossiers),
.sticky[id^="sticky-field"]:not(#sticky-field) {
    height: 30px;
    background: #fffacd;
}

.sticky[id^="sticky-dossiers"]:not(#sticky-dossiers):nth-child(even),
.sticky[id^="sticky-field"]:not(#sticky-field):nth-child(even) {
    background: #fff9e6;
}

.sticky span {
    font-size: 8px;
    font-weight: bold;
    text-align: left;
    color: #1a1a1a;
    text-transform: uppercase;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

/* Larger text for numbered stickies */
.sticky[id^="sticky-dossiers"]:not(#sticky-dossiers) span,
.sticky[id^="sticky-field"]:not(#sticky-field) span {
    font-size: 9px;
}

.sticky:hover {
    transform: translateX(-5px);
    box-shadow: -4px 2px 10px rgba(0,0,0,0.4);
    background: #fff9e6;
}

.sticky.hidden {
    display: none;
}

/* FOLDER COVER */
.folder-cover {
    padding: 40px 60px;
    background: #d4c5a0;
    min-height: 1000px;
    position: relative;
}

/* MAIN CLASSIFICATION HEADER */
.classification-header {
    text-align: center;
    border: 4px double #1a1a1a;
    padding: 30px 20px;
    background: #e8dfc4;
    margin-bottom: 30px;
    position: relative;
}

.classification-header p:first-child {
    font-size: 42px;
    font-weight: bold;
    color: #1a1a1a;
    letter-spacing: 12px;
    margin-bottom: 15px;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}

.classification-header p:nth-child(2) {
    font-size: 12px;
    letter-spacing: 3px;
    color: #1a1a1a;
    margin-top: 10px;
}

.classification-header p:last-child {
    font-size: 10px;
    letter-spacing: 2px;
    color: #333;
    margin-top: 15px;
}

/* DOCUMENT HEADER INFO */
.folder-title {
    margin: 30px 0 20px 0;
    padding: 0;
    font-size: 11px;
    line-height: 1.8;
}

.folder-title p {
    margin: 0 0 5px 0;
    letter-spacing: 0.5px;
    color: #1a1a1a;
}

.folder-title .red-text {
    color: #8b0000;
    font-weight: bold;
}

.file-number {
    display: none;
}

/* STAMPS CONTAINER */
.stamp-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    pointer-events: none;
}

/* Individual Stamps */
.stamp-top-secret {
    position: absolute;
    top: 50px;
    right: 80px;
    font-size: 22px;
    font-weight: bold;
    color: #8b0000;
    border: 4px solid #8b0000;
    padding: 8px 18px;
    transform: rotate(15deg);
    letter-spacing: 3px;
    opacity: 0.65;
}

.stamp-classified {
    position: absolute;
    top: 280px;
    left: 50px;
    font-size: 12px;
    font-weight: bold;
    color: #8b0000;
    border: 2px solid #8b0000;
    padding: 5px 12px;
    transform: rotate(-5deg);
    letter-spacing: 2px;
    opacity: 0.5;
}

.stamp-confidential {
    position: absolute;
    bottom: -180px;
    right: 100px;
    font-size: 10px;
    font-weight: bold;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 4px 10px;
    transform: rotate(8deg);
    letter-spacing: 1px;
    opacity: 0.45;
}

.stamp-restricted {
    position: absolute;
    top: 320px;
    right: 60px;
    font-size: 9px;
    font-weight: bold;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 4px 8px;
    transform: rotate(-12deg);
    letter-spacing: 1px;
    opacity: 0.4;
}

.stamp-authorized {
    position: absolute;
    top: 140px;
    left: 70px;
    font-size: 8px;
    font-weight: bold;
    color: #8b0000;
    border: 2px solid #8b0000;
    padding: 4px 8px;
    transform: rotate(-18deg);
    letter-spacing: 1px;
    opacity: 0.4;
    text-align: center;
    line-height: 1.3;
}

/* SECURE CHANNELS */
.secure-channels {
    border-top: 3px solid #1a1a1a;
    padding-top: 40px;
    margin-top: 60px;
}

.secure-channels h2 {
    font-size: 20px;
    text-align: center;
    letter-spacing: 6px;
    margin-bottom: 30px;
    color: #1a1a1a;
    font-weight: bold;
}

#channelsList {
    background: #fff;
    border: 2px solid #1a1a1a;
    min-height: 150px;
    padding: 25px;
}

.channel-entry {
    border-left: 4px solid #1a1a1a;
    padding-left: 20px;
    margin-bottom: 25px;
}

.channel-entry:last-child {
    margin-bottom: 0;
}

.channel-entry h3 {
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.channel-entry p {
    font-size: 11px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
}

.channel-entry a {
    color: #1a1a1a;
    text-decoration: underline;
    font-size: 11px;
}

.channel-entry a:hover {
    color: #8b0000;
}

/* PAGE FOOTER */
.folder-cover::after {
    content: 'PAGE 0';
    position: absolute;
    bottom: 30px;
    right: 60px;
    font-size: 11px;
    color: #666;
    letter-spacing: 2px;
}

/* CLASSIFIED PAGE */
.classified-page {
    background: #f5f0e8;
    padding: 50px 60px;
    min-height: 1000px;
    position: relative;
    border: 3px solid #1a1a1a;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1a1a1a;
}

.classification-mark {
    font-size: 11px;
    font-weight: bold;
    color: #8b0000;
    border: 2px solid #8b0000;
    padding: 4px 8px;
    letter-spacing: 2px;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    flex: 1;
}

.page-number {
    font-size: 10px;
    color: #666;
    letter-spacing: 1px;
}

.page-footer {
    position: absolute;
    bottom: 30px;
    right: 60px;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* CONTENT SECTIONS */
.content-section {
    margin-top: 30px;
}

.typewriter-section {
    background: #fff;
    border: 1px solid #999;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.typewriter-section h2 {
    font-size: 14px;
    text-decoration: underline;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.editable-content {
    font-size: 13px;
    line-height: 1.9;
}

/* COMMENT SECTION */
.comment-section {
    background: #f9f9f9;
    border: 2px dashed #999;
    padding: 25px;
    margin-top: 40px;
}

.comment-section h2 {
    font-size: 13px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.comment-form textarea {
    width: 100%;
    height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 12px;
    border: 1px solid #999;
    background: #fff;
    resize: vertical;
    margin-bottom: 10px;
}

.comment-form button {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.comment-form button:hover {
    background: #8b0000;
}

.comment-notice {
    font-size: 9px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.comments-list {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.comment-item {
    background: #fff;
    border-left: 3px solid #1a1a1a;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    position: relative;
}

.comment-meta {
    font-size: 9px;
    color: #888;
    margin-bottom: 8px;
}

.comment-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #8b0000;
    color: #fff;
    border: none;
    padding: 3px 8px;
    font-size: 8px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    display: none;
}

.comment-delete-btn:hover {
    background: #660000;
}

/* Show delete button ONLY when admin is logged in */
body.admin-active .comment-delete-btn {
    display: block;
}

/* DOSSIER GRID */
.dossier-grid {
    display: grid;
    gap: 30px;
}

.dossier-entry {
    background: #fff;
    border: 2px solid #1a1a1a;
    padding: 20px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.dossier-image {
    width: 200px;
    height: 200px;
    border: 3px solid #1a1a1a;
    overflow: hidden;
}

.dossier-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dossier-info h3 {
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 5px;
    letter-spacing: 1px;
}

.dossier-detail {
    font-size: 11px;
    margin-bottom: 8px;
}

.dossier-description {
    font-size: 12px;
    margin-top: 15px;
    line-height: 1.6;
}

/* FIELD RECORDS GRID */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.field-entry {
    background: #fff;
    border: 1px solid #999;
    padding: 15px;
}

.field-image {
    width: 100%;
    height: 250px;
    border: 2px solid #1a1a1a;
    overflow: hidden;
    margin-bottom: 15px;
}

.field-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.field-caption {
    font-size: 11px;
}

.field-caption p {
    margin-bottom: 8px;
}

/* MOBILE ADMIN BUTTON */
.mobile-admin-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid #8b0000;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.mobile-admin-btn:hover {
    background: #8b0000;
    transform: scale(1.1);
}

.mobile-admin-btn:active {
    transform: scale(0.95);
}

/* ADMIN CONTROLS */
.admin-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.15);
    padding: 10px;
    display: none;
    gap: 10px;
    z-index: 1000;
    flex-wrap: wrap;
}

.admin-controls.active {
    display: flex;
}

.admin-controls button {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 8px 12px;
    font-size: 9px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.admin-controls button:hover {
    background: #8b0000;
}

/* ADMIN OVERLAY */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.admin-overlay.active {
    display: flex;
}

.admin-login {
    background: #e8dfc4;
    padding: 40px;
    border: 3px solid #8b0000;
    max-width: 400px;
    text-align: center;
}

.admin-login h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #8b0000;
    letter-spacing: 2px;
}

.admin-login input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    border: 1px solid #999;
    font-size: 13px;
}

.admin-login button {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    margin: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-login button:hover {
    background: #8b0000;
}

.error-message {
    color: #8b0000;
    font-size: 11px;
    margin-top: 10px;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #e8dfc4;
    padding: 40px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 3px solid #1a1a1a;
    position: relative;
}

.modal-large {
    max-width: 800px;
    width: 90%;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #8b0000;
}

.close:hover {
    color: #000;
}

.editor-section {
    margin-bottom: 20px;
}

.editor-section label {
    display: block;
    font-size: 11px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.editor-section input,
.editor-section textarea {
    width: 100%;
    padding: 10px;
    font-family: 'Courier New', monospace;
    border: 1px solid #999;
    font-size: 12px;
}

.editor-section textarea {
    height: 80px;
    resize: vertical;
}

.editor-section small {
    display: block;
    font-size: 9px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* IMAGE MANAGER STYLES */
.image-manager-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #1a1a1a;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
    color: #555;
    border-bottom: 3px solid transparent;
    letter-spacing: 1px;
}

.tab-btn.active {
    color: #1a1a1a;
    border-bottom: 3px solid #8b0000;
    font-weight: bold;
}

.tab-btn:hover {
    color: #1a1a1a;
}

.image-tab {
    display: none;
}

.image-tab.active {
    display: block;
}

/* Mode Selector (Image/Text toggle) */
.tab-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #999;
}

.selector-btn {
    background: #fff;
    border: 2px solid #999;
    padding: 8px 15px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    color: #555;
    letter-spacing: 0.5px;
}

.selector-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.selector-btn:hover {
    background: #f0f0f0;
}

.selector-btn.active:hover {
    background: #1a1a1a;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

.image-upload-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #999;
    margin-bottom: 20px;
}

.existing-items {
    max-height: 400px;
    overflow-y: auto;
}

.item-preview {
    background: #fff;
    border: 1px solid #999;
    padding: 15px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 15px;
    align-items: center;
}

.item-preview.text-entry {
    grid-template-columns: 1fr auto;
}

.item-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid #1a1a1a;
}

.item-preview-info {
    font-size: 11px;
}

.item-preview-info p {
    margin-bottom: 5px;
}

.item-preview-info strong {
    color: #1a1a1a;
}

.item-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-preview button {
    background: #8b0000;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 9px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.item-preview button.edit-btn {
    background: #1a1a1a;
}

.item-preview button.edit-btn:hover {
    background: #333;
}

.item-preview button:hover {
    background: #660000;
}

/* Text Entry Display Styles */
.text-entry-display {
    background: #fff;
    border: 2px solid #1a1a1a;
    padding: 25px;
    margin-bottom: 30px;
}

.text-entry-display h3 {
    font-size: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 8px;
}

.text-entry-display h4 {
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #333;
}

.text-entry-display p {
    font-size: 12px;
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
    .document-container {
        padding: 0;
    }
    
    .sticky-notes {
        right: -2px;
        top: 60px;
    }
    
    .sticky {
        width: 90px;
        height: 30px;
        padding: 6px 8px;
    }
    
    .sticky span {
        font-size: 7px;
    }
    
    .folder-cover {
        padding: 30px 20px;
    }
    
    .folder-cover::before {
        font-size: 16px;
        top: 30px;
        right: 30px;
    }
    
    .classification-header p:first-child {
        font-size: 28px;
        letter-spacing: 6px;
    }
    
    .classified-page {
        padding: 30px 20px;
    }
    
    .dossier-entry {
        grid-template-columns: 1fr;
    }
    
    .dossier-image {
        width: 100%;
        margin: 0 auto;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .item-preview {
        grid-template-columns: 1fr;
    }
    
    .item-preview img {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }
}