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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #00d9ff;
    margin-bottom: 10px;
}

header p {
    color: #888;
    font-size: 1.1rem;
}

.search-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 0.9rem;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #00d9ff;
}

.options-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #aaa;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00d9ff;
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-search {
    width: 100%;
    background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
    color: #1a1a2e;
    font-size: 1.1rem;
}

.btn-search:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.btn-search:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.btn-export {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #1a1a2e;
}

.folder-name {
    color: #00d9ff;
    font-style: italic;
}

.stats {
    background: rgba(0, 217, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.stats.show { display: block; }

.results-container {
    max-height: 600px;
    overflow-y: auto;
}

.result-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #00d9ff;
}

.result-item .file-path {
    font-weight: 600;
    color: #00d9ff;
    margin-bottom: 10px;
    word-break: break-all;
}

.result-item .match-info {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.result-item .match-preview {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-item .match-preview .highlight {
    background: #ffeb3b;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
}

.line-number {
    color: #666;
    margin-right: 10px;
    user-select: none;
}

.no-results {
    text-align: center;
    color: #888;
    padding: 40px;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 217, 255, 0.3);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 20px;
    color: #00d9ff;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #00d9ff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00a8cc;
}

@media (max-width: 600px) {
    header h1 { font-size: 1.8rem; }
    .options-row { flex-direction: column; gap: 10px; }
    .upload-section { flex-direction: column; align-items: stretch; }
}