* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Fredoka One', cursive;
}

body {
    background-color: #000;
    color: #fff;
    padding: 20px;
    font-size: 16px; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px; 
}

h1, h2 {
    margin-bottom: 20px;
    text-align: center;
}
h1 {
    font-size: 2em;
}
h2 {
    font-size: 1.5em;
}


.upload-section {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-btn {
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
    border: 1px solid #555;
    font-size: 1em;
}

.upload-btn:hover {
    background-color: #444;
}

#currentFile {
    font-size: 0.9em; 
    min-height: 1.2em;
    text-align: center; 
    word-break: break-all; 
}

.search-section {
    margin-bottom: 20px;
}

.search-input {
    display: flex;
    margin-bottom: 15px; 
}

.search-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    border-radius: 5px 0 0 5px;
    font-size: 1em;
    min-width: 0; 
}

.search-input button {
    padding: 10px 15px;
    background-color: #555;
    border: 1px solid #555;
    border-left: none;
    color: #fff;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    font-size: 1em;
}

.search-input button:hover {
    background-color: #666;
}

.search-options {
    display: flex;
    gap: 15px; 
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.search-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.result-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}


.file-browser, .search-results {
    background-color: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 15px;
    max-height: 500px; 
    overflow-y: auto;
}

.file-list {
    font-family: monospace;
    font-size: 0.9em;
    overflow-x: auto; 
}

.file-list .file, .file-list .folder {
    padding: 5px 8px;
    white-space: nowrap;
    border-radius: 3px;
    margin-bottom: 2px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    min-width: 0; 
}

.file-list .folder-name-wrapper {
    cursor: pointer;
    flex-grow: 1; 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; 
    margin-right: 5px; 
}

.file-list .file:hover, .file-list .folder-name-wrapper:hover {
    background-color: #2a2a2a;
}

.file-list .folder {
    color: #aaa;
}

.file-list .folder .fas {
    color: #ffcc66;
    margin-right: 5px;
}

.file-list .folder .folder-name-wrapper .fas.fa-folder-open { 
    color: #ffe08c;
}

.file-list .file {
    color: #fff;
    cursor: pointer; 
}

.block-folder-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0 5px;
    font-size: 0.9em;
    flex-shrink: 0; 
}

.block-folder-btn:hover .fa-ban {
    color: #ccc;
}

.block-folder-btn.is-blocked .fa-ban {
    color: #ff6b6b; 
}

.folder.blocked-explicitly > .folder-name-wrapper > span,
.folder.blocked-explicitly > .folder-name-wrapper > i.fas {
    text-decoration: line-through;
    color: #ff7b7b !important; 
}

.folder.blocked-implicitly > .folder-name-wrapper > span,
.folder.blocked-implicitly > .folder-name-wrapper > i.fas {
    text-decoration: line-through;
    color: #888 !important; 
}

.file.blocked-implicitly {
    text-decoration: line-through;
    color: #888 !important;
}
.file.blocked-implicitly .fas {
    color: #888 !important;
}

.results-list .result {
    padding: 10px;
    margin-bottom: 10px;
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 5px;
}

.results-list .result.error {
    background-color: #2c1d1d;
    color: #ff8282;
    border-color: #5c3030;
}

.results-list .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.results-list .result-path {
    font-weight: bold;
    color: #87CEFA;
    word-break: break-all;
    cursor: pointer; 
}
.results-list .result-path:hover {
    text-decoration: underline;
}


.results-list .result-count {
    font-size: 0.9em;
    color: #aaa;
    background-color: #333;
    padding: 2px 6px;
    border-radius: 3px;
}

.view-details-btn {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.view-details-btn:hover {
    background-color: #444;
}

.view-details-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.details-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.result-content {
    white-space: pre-wrap;
    font-family: monospace;
    background-color: #282828;
    padding: 10px;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 0.85em;
    max-height: 300px;
    overflow-y: auto;
}

.details-container .result-content {
    background-color: transparent;
    padding: 0;
    margin-top: 0;
    max-height: none; 
}

.highlight {
    background-color: #FFD700;
    color: black;
    padding: 0.5px 1px;
    border-radius: 2px;
}

.match-context-block {
    margin-bottom: 10px;
    padding: 8px;
    background-color: #252525;
    border-radius: 4px;
    border: 1px solid #383838;
}

.match-context-block:last-child {
    margin-bottom: 0;
}

.match-line, .context-line {
    font-family: monospace;
    font-size: 0.85em;
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.line-number {
    display: inline-block;
    width: 40px; 
    color: #777;
    text-align: right;
    margin-right: 10px;
    user-select: none;
    -webkit-user-select: none; 
}

.match-line {
    background-color: #2c2c2c;
}

.match-line .line-number {
    color: #999;
}

.context-line {
    color: #aaa;
}

.context-separator {
    text-align: center;
    color: #555;
    margin: 8px 0;
    font-size: 0.8em;
    font-family: monospace;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #888;
    font-style: italic;
}

input:disabled, button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.loading {
    padding: 15px;
    text-align: center;
    color: #aaa;
    font-style: italic;
}

.error {
    padding: 10px;
    text-align: center;
    color: #ff6b6b;
    background-color: #2a2020;
    border: 1px solid #553030;
    border-radius: 5px;
    margin-top: 10px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #222;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.fas {
    margin-right: 5px;
    color: #888;
}

.upload-btn .fas, .search-input button .fas {
    color: #fff;
}

.file-list .file .fas {
    color: #77b6ff;
    margin-right: 5px;
}

/* Mobile specific styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px; 
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.3em;
    }
    .result-section {
        grid-template-columns: 1fr;
    }
    .search-options {
        gap: 10px; 
    }
    .search-options label {
        font-size: 0.85em; 
    }
    .file-browser, .search-results {
        max-height: 350px; 
    }
    .upload-btn, .search-input input, .search-input button {
        font-size: 0.9em; 
    }
}

@media (max-width: 480px) {
    .search-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .search-options label {
        width: 100%; 
    }
    .view-details-btn {
        padding: 5px 10px;
        font-size: 0.8em;
    }
     .line-number {
        width: 35px;
        margin-right: 5px;
    }
    .match-line, .context-line, .details-container .result-content, .result-content {
        font-size: 0.8em; 
    }
}