:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --header-bg: #2c3e50;
    --header-text: white;
    --nav-bg: #ecf0f1;
    --link-color: #2980b9;
    --border-color: #ddd;
    --btn-bg: #fff;
    --btn-border: #ccc;
    --btn-primary: #3498db;
    --btn-danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --error: #e74c3c;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
}

.explorer-layout {
    display: flex;
    gap: 2rem;
    height: calc(100vh - 180px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.folder-tree ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.folder-tree li {
    margin: 0.25rem 0;
}

.folder-item {
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
    user-select: none;
}

.folder-item:hover {
    background-color: #f8f9fa;
}

.folder-item.active {
    background-color: #ebf5fb;
    color: var(--link-color);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-bar input, .search-bar select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-bar input {
    width: 250px;
}

.file-list-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-y: auto;
    flex: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-list {
    width: 100%;
    border-collapse: collapse;
}

.file-list th, .file-list td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.file-list th {
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    color: #555;
    font-weight: 600;
    z-index: 10;
}

.file-list tbody tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #f1f1f1;
}

.btn-small {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--btn-primary);
    color: white;
    border: 1px solid #2980b9;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: var(--btn-danger);
    color: white;
    border: 1px solid #c0392b;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Status Colors */
.status-ok { color: var(--success); font-weight: 500; }
.status-pending { color: var(--warning); font-weight: 500; }
.status-error { color: var(--error); font-weight: 500; }

.error-msg {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.3rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed var(--btn-primary);
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: 8px;
    background: #f8f9fa;
    color: #555;
    transition: background 0.2s;
}

.drop-zone.dragover {
    background: #ebf5fb;
    border-color: #2980b9;
}

.link {
    color: var(--link-color);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Search Results */
.search-results {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.search-results h3 {
    margin-top: 0;
    color: #2c3e50;
}

.sources {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #555;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.sources h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.sources ul {
    padding-left: 1.5rem;
    margin: 0;
}

.sources li {
    margin-bottom: 0.5rem;
}
