* {
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', system-ui, sans-serif;
}

body {
    margin: 0;
    padding: 20px;
    background: #1a1e1a; /* deep dark green-grey */
    color: #c8c6b0; /* khaki light text */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app {
    max-width: 820px;
    width: 100%;
    background: #252b25; /* hmmm yummy dark olive base */
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7), inset 0 1px 2px rgba(255,255,240,0.06);
    border: 1px solid #3b4a3b;
    backdrop-filter: blur(1px);
    transition: all 0.2s;
}

h1 {
    margin-top: 0;
    font-weight: 500;
    font-size: 1.9rem;
    letter-spacing: 1px;
    color: #d4d0b0;
    text-shadow: 0 2px 0 #1e2a1e, 0 0 8px rgba(100,120,80,0.3);
    border-bottom: 2px solid #3e5440;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
h1::before {
    content: "DR2/AMRTS ";
    font-size: 1.8rem;
    filter: drop-shadow(0 0 6px #5f7a4a);
}

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #364536;
    margin-bottom: 24px;
    padding-bottom: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    color: #9ba78b;
    letter-spacing: 0.3px;
    position: relative;
}
.tab-btn:hover {
    background: #313f31;
    color: #d4d0b0;
}
.tab-btn.active {
    background: #394d39;
    color: #f0edd0;
    box-shadow: inset 0 -2px 0 #a0b88a, 0 2px 8px rgba(0,0,0,0.4);
}
.tab-btn.active::after {
    content: "▼";
    font-size: 0.6rem;
    margin-left: 6px;
    opacity: 0.6;
}

.tab-content {
    display: none;
    animation: fadeSlide 0.3s ease;
}
.tab-content.active {
    display: block;
}

@keyframes fadeSlide {
    0% { opacity: 0.3; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

.drop-zone {
    border: 2px dashed #4f664f;
    border-radius: 10px;
    padding: 32px 20px;
    text-align: center;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    margin-bottom: 16px;
    background: #202a20;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.5);
}
.drop-zone:hover {
    background: #283428;
    border-color: #7b9a7b;
}
.drop-zone.dragover {
    background: #2f402f;
    border-color: #b8d0a0;
    box-shadow: 0 0 20px rgba(140,180,120,0.25);
}
.drop-zone p {
    margin: 0;
    color: #a8b89a;
    font-weight: 400;
    letter-spacing: 0.3px;
}
.drop-zone p strong {
    color: #d0d8b0;
    font-weight: 600;
}
.drop-zone input[type="file"] {
    display: none;
}

button {
    background: #3d5a3d;
    color: #efe8d0;
    border: 1px solid #5d7a4d;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 3px 0 #1d2a1d, inset 0 1px 0 #7a9a6a;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.9rem;
}
button:hover:not(:disabled) {
    background: #4d6e4d;
    border-color: #7da06d;
    box-shadow: 0 3px 0 #1d2a1d, inset 0 1px 0 #9ab88a;
}
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

#create-status,
#extract-status,
#add-base-status,
#add-files-status {
    min-height: 1.8em;
    margin: 10px 0 6px;
    padding: 4px 10px;
    background: #1f281f;
    border-left: 4px solid #5f7a4a;
    color: #c0c8a8;
    font-size: 0.95rem;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
}

#create-download,
#extract-download,
#add-download {
    margin-top: 14px;
    padding: 8px 0;
}
#create-download a,
#extract-download a,
#add-download a {
    display: inline-block;
    background: #2f3f2f;
    color: #d4d8b0;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #5f7a4f;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}
#create-download a:hover,
#extract-download a:hover,
#add-download a:hover {
    background: #3f583f;
    color: #f0f0d0;
}

.file-list {
    max-height: 160px;
    overflow-y: auto;
    background: #1c241c;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    text-align: left;
    margin: 8px 0;
    border: 1px solid #3a4d3a;
    color: #b0bca0;
}
.file-list .entry {
    padding: 3px 0;
    border-bottom: 1px solid #2e3e2e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.file-list .entry:last-child {
    border-bottom: none;
}
.file-list .entry .filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-list .entry .filesize {
    flex-shrink: 0;
    margin-left: 12px;
    color: #7a9a6a;
}

/* scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    background: #1f2a1f;
}
::-webkit-scrollbar-thumb {
    background: #4c664c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5f7a5f;
}

/* subtle camo-like texture (optional) */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(70,90,60,0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(50,70,50,0.04) 0%, transparent 40%),
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(40,55,40,0.02) 20px, rgba(40,55,40,0.02) 21px);
    pointer-events: none;
    z-index: 0;
}
#app {
    position: relative;
    z-index: 1;
}

/* responsive */
@media (max-width: 600px) {
    #app {
        padding: 16px;
    }
    h1 {
        font-size: 1.5rem;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .drop-zone {
        padding: 20px 12px;
    }
}



/* CRC32 css */
.crc-container {
    padding: 8px 0;
}

.mode-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 2px solid #364536;
    padding-bottom: 12px;
}

.mode-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    color: #9ba78b;
    letter-spacing: 0.3px;
}

.mode-btn:hover {
    background: #313f31;
    color: #d4d0b0;
}

.mode-btn.active {
    background: #394d39;
    color: #f0edd0;
    box-shadow: inset 0 -2px 0 #a0b88a, 0 2px 8px rgba(0,0,0,0.4);
}

.mode-content {
    display: none;
    animation: fadeSlide 0.3s ease;
}

.mode-content.active {
    display: block;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    color: #c0c8a8;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #1c241c;
    border: 1px solid #3a4d3a;
    border-radius: 8px;
    color: #d4d8b0;
    font-size: 1.1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: 'Segoe UI', 'Arial', system-ui, sans-serif;
}

.input-group textarea {
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.6;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: #7a9a6a;
    box-shadow: 0 0 0 3px rgba(90, 140, 90, 0.2);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #5a6a5a;
}

.result-group {
    background: #1f281f;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid #5f7a4a;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #2a3a2a;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item label {
    color: #9ba78b;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.result-item .crc-value {
    color: #d4d8b0;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: 'Consolas', 'Courier New', monospace;
    background: #141a14;
    padding: 2px 12px;
    border-radius: 4px;
    border: 1px solid #2e3e2e;
    word-break: break-all;
    max-width: 60%;
    text-align: right;
}

.result-item:first-child .crc-value {
    color: #8ab87a;
}

.result-item:nth-child(2) .crc-value {
    color: #b8c88a;
}

.bulk-results {
    max-height: 300px;
    overflow-y: auto;
    background: #141a14;
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid #2e3e2e;
    font-size: 0.85rem;
}

.bulk-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #2a3a2a;
    gap: 12px;
}

.bulk-entry:last-child {
    border-bottom: none;
}

.bulk-line {
    color: #b0bca0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.bulk-hash {
    color: #b8c88a;
    font-family: 'Consolas', 'Courier New', monospace;
    flex-shrink: 0;
    font-size: 0.8rem;
}

#copy-bulk-btn {
    background: #3d5a3d;
    color: #efe8d0;
    border: 1px solid #5d7a4d;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    box-shadow: 0 3px 0 #1d2a1d, inset 0 1px 0 #7a9a6a;
}

#copy-bulk-btn:hover:not(:disabled) {
    background: #4d6e4d;
    border-color: #7da06d;
}

#copy-bulk-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* responsive tweaks */
@media (max-width: 600px) {
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .result-item .crc-value {
        max-width: 100%;
        width: 100%;
        text-align: left;
    }
    .bulk-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .bulk-hash {
        font-size: 0.75rem;
    }
}
