/* alexstore — custom styles (thin layer on top of oat.css) */

/* Layout */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

nav button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

main {
    padding: 1rem 2rem;
    max-width: 960px;
    margin: 0 auto;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#path-filter {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 4px;
    background: var(--color-bg, #fff);
    color: var(--color-fg, #333);
    cursor: pointer;
    font-size: 0.875rem;
}

.btn.primary {
    background: var(--color-primary, #0066cc);
    color: white;
    border-color: var(--color-primary, #0066cc);
}

/* Table */
#files-table {
    width: 100%;
    border-collapse: collapse;
}

#files-table th,
#files-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border, #eee);
}

#files-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* File name cell */
.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-name .icon {
    font-size: 1.125rem;
}

/* Folder row */
.folder .file-name .icon::before { content: '📁'; }
.folder .file-name .icon { font-size: 1.125rem; }
.folder td .file-name::before { content: '📂'; margin-right: 0.25rem; }
.file td .file-name::before { content: '📄'; margin-right: 0.25rem; }

/* Visibility badges */
.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge.public { background: #d4edda; color: #155724; }
.badge.unlisted { background: #fff3cd; color: #856404; }
.badge.private { background: #f8d7da; color: #721c24; }
.badge.shared { background: #cce5ff; color: #004085; }

/* Folder indicator */
.folder-name::after {
    content: '/';
    font-weight: 400;
    opacity: 0.6;
}

/* Action buttons */
.actions {
    display: flex;
    gap: 0.25rem;
}

.actions button {
    background: none;
    border: 1px solid transparent;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 3px;
    font-size: 1rem;
}

.actions button:hover {
    background: var(--color-bg-hover, #f0f0f0);
    border-color: var(--color-border, #ccc);
}

/* Dialogs */
dialog {
    border: 1px solid var(--color-border, #ccc);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

dialog h2 {
    margin-top: 0;
    font-size: 1.125rem;
}

dialog form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

dialog label {
    font-size: 0.875rem;
    font-weight: 500;
}

dialog input[type="text"],
dialog select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 4px;
    font-size: 0.875rem;
}

dialog input[type="file"] {
    font-size: 0.875rem;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Share list in share dialog */
.share-list, .grant-list, .link-list {
    margin-top: 1rem;
    border-top: 1px solid var(--color-border, #eee);
    padding-top: 0.5rem;
}

.share-item, .grant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.share-item button, .grant-item button {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc3545;
    font-size: 0.875rem;
}

.grant-target {
    padding: 0.5rem;
    background: var(--color-bg-hover, #f5f5f5);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Empty state */
#empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: #999;
}

/* Responsive */
@media (max-width: 600px) {
    header, main {
        padding: 1rem;
    }
    .toolbar {
        flex-direction: column;
    }
    #path-filter {
        max-width: none;
    }
    #files-table th:nth-child(3),
    #files-table td:nth-child(3),
    #files-table th:nth-child(4),
    #files-table td:nth-child(4) {
        display: none;
    }
}
