/* ============================================================================
   Rvmat Binarizer/Unbinarizer for ARMA 2
   By 209 Angry Dev Team - Simple 2009-style theme
   ============================================================================ */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    background: #e8e8e8;
    color: #222;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(#4a76b8, #2e5591);
    border-bottom: 1px solid #1e3d6b;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    color: #2e5591;
    border: 1px solid #1e3d6b;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.header-text h1 {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
}

.header-text .subtitle {
    font-size: 11px;
    color: #c6d4e8;
}

.header-badge {
    margin-left: auto;
    font-size: 11px;
    color: #c6d4e8;
    border: 1px solid #5a7db8;
    padding: 3px 8px;
    border-radius: 3px;
}

/* Toolbar */
.toolbar {
    background: linear-gradient(#f8f8f8, #e2e2e2);
    border-bottom: 1px solid #aaa;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #b8b8b8;
    margin: 0 4px;
}

.btn {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    padding: 5px 14px;
    border: 1px solid #999;
    border-radius: 3px;
    background: linear-gradient(#ffffff, #d8d8d8);
    color: #222;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn:hover {
    background: linear-gradient(#ffffff, #ececec);
    border-color: #777;
}

.btn:active {
    background: linear-gradient(#d0d0d0, #e8e8e8);
}

.btn:disabled {
    color: #aaa;
    background: #eeeeee;
    border-color: #ccc;
    cursor: default;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(#6da2e0, #3b74b8);
    border-color: #2d5a92;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(#82b2e8, #4a84c8);
    border-color: #1e4a80;
}

.btn-primary:disabled {
    background: #a8c0dd;
    border-color: #b0c0d0;
    color: #e8e8e8;
}

.btn-success {
    background: linear-gradient(#7fc47f, #4a9a4a);
    border-color: #2f7a2f;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-success:hover {
    background: linear-gradient(#90d490, #5aa85a);
    border-color: #206a20;
}

.btn-success:disabled {
    background: #b4ccb4;
    border-color: #b0c0b0;
    color: #e8e8e8;
}

.btn-danger {
    color: #a02020;
    border-color: #c08080;
}

.btn-danger:hover {
    background: linear-gradient(#ffe8e8, #f8d0d0);
    border-color: #a04040;
}

/* Status Bar */
.status-bar {
    background: linear-gradient(#f0f0f0, #e0e0e0);
    border-top: 1px solid #aaa;
    padding: 5px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: #444;
    flex-shrink: 0;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a9a4a;
    border: 1px solid #2f7a2f;
}

.status-dot.error {
    background: #d04040;
    border-color: #a02020;
}

.status-dot.processing {
    background: #d0a020;
    border-color: #a08010;
}

.status-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

/* Small GitHub button */
.btn-github {
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    padding: 3px 10px;
    border: 1px solid #999;
    border-radius: 3px;
    background: linear-gradient(#ffffff, #e0e0e0);
    color: #333;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.btn-github:hover {
    background: linear-gradient(#ffffff, #f0f0f0);
    border-color: #666;
    color: #2e5591;
}

.btn-github:active {
    background: linear-gradient(#d8d8d8, #e8e8e8);
}

/* TOS link */
.tos-link {
    color: #2e5591;
    text-decoration: underline;
    cursor: pointer;
}

.tos-link:hover {
    color: #1e3d6b;
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
}

/* Drop Zone Overlay */
.drop-zone-overlay {
    position: absolute;
    inset: 0;
    background: rgba(245, 245, 245, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.drop-zone-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drop-zone-box {
    border: 2px dashed #4a76b8;
    border-radius: 4px;
    padding: 40px 60px;
    text-align: center;
    background: #fff;
}

.drop-zone-box h2 {
    font-size: 18px;
    font-weight: bold;
    color: #2e5591;
    margin-bottom: 6px;
}

.drop-zone-box p {
    font-size: 12px;
    color: #666;
}

/* Editor Panels */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

.panel-header {
    background: linear-gradient(#f4f4f4, #e0e0e0);
    border-bottom: 1px solid #bbb;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 12px;
}

.panel-header .tab {
    font-weight: bold;
    color: #444;
    padding: 2px 8px;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
}

.panel-header .file-name {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    color: #666;
}

.panel-header .file-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: auto;
}

.file-badge.binary {
    background: #fff0dd;
    color: #b05800;
    border: 1px solid #e0a060;
}

.file-badge.text {
    background: #e8f4e8;
    color: #2f7a2f;
    border: 1px solid #80c080;
}

.editor-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#editor {
    width: 100%;
    height: 100%;
    background: #fff;
    color: #222;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    border: none;
    outline: none;
    resize: none;
    tab-size: 4;
    -moz-tab-size: 4;
    white-space: pre;
    overflow: auto;
}

#editor::placeholder {
    color: #999;
}

/* Welcome State */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #666;
    padding: 30px;
    background: #f5f5f5;
}

.welcome.hidden {
    display: none;
}

.welcome h2 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.welcome p {
    font-size: 12px;
    text-align: center;
    max-width: 400px;
    line-height: 1.5;
}

.welcome .shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.welcome .shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.welcome .shortcut-key {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 2px 8px;
    color: #444;
    min-width: 60px;
    text-align: center;
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    background: #fff;
    border: 1px solid #999;
    border-left-width: 5px;
    padding: 8px 14px;
    font-size: 12px;
    color: #222;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    max-width: 380px;
}

.toast.success { border-left-color: #4a9a4a; }
.toast.error   { border-left-color: #d04040; }
.toast.info    { border-left-color: #3b74b8; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: #fff;
    border: 1px solid #666;
    border-radius: 3px;
    max-width: 620px;
    width: 92%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(#4a76b8, #2e5591);
    color: #fff;
    padding: 8px 14px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e3d6b;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    padding: 0 2px;
}

.modal-close:hover {
    color: #ffe080;
}

.modal-body {
    padding: 16px 20px;
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    overflow-y: auto;
}

.modal-body h2 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #2e5591;
}

.modal-body h3 {
    font-size: 13px;
    margin-top: 14px;
    margin-bottom: 6px;
    color: #333;
}

.modal-body p {
    margin-bottom: 8px;
}

.modal-body ul {
    margin: 6px 0 10px 20px;
}

.modal-body li {
    margin-bottom: 4px;
}

.modal-footer {
    padding: 8px 14px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Hidden file input */
#fileInput {
    display: none;
}

/* Responsive */
@media (max-width: 700px) {
    .header { padding: 8px 12px; }
    .toolbar { padding: 6px 12px; }
    .status-bar { padding: 4px 12px; flex-wrap: wrap; gap: 10px; }
    .header-badge { display: none; }
    .status-links { gap: 8px; }
    .btn-github { font-size: 10px; padding: 2px 8px; }
}