/* Base styles */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 1024px;
}

.hidden {
    display: none !important;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    max-width: 450px;
    margin: 4rem auto 0 auto;
}

.card h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Form inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #5b6270;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Banners */
.banner {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.banner.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.banner.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* Console Header */
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.breadcrumbs {
    font-size: 1.1rem;
    color: #4b5563;
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--primary-color);
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-item::after {
    content: " / ";
    color: #9ca3af;
    cursor: default;
    text-decoration: none;
    display: inline-block;
    padding: 0 0.25rem;
}

.breadcrumb-item:last-child {
    color: #1f2937;
    cursor: default;
    font-weight: 500;
}

.breadcrumb-item:last-child::after {
    content: "";
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.file-upload-label {
    cursor: pointer;
}

/* Dropzone */
.drop-zone {
    border: 2px dashed #d1d5db;
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.drop-zone-prompt {
    text-align: center;
    padding: 1.5rem 0;
    color: #6b7280;
    pointer-events: none;
    font-weight: 500;
}

/* Files Table */
.files-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
}

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

.files-table th {
    background-color: #f3f4f6;
    font-weight: 600;
}

.files-table tbody tr:hover {
    background-color: #f9fafb;
}

.files-table tr.folder-row td.item-name {
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
}

.files-table tr.folder-row td.item-name:hover {
    text-decoration: underline;
}

.files-table td.item-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-table .actions-cell {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #9ca3af;
    background-color: #fff;
    border-radius: 6px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Floating Upload Progress Widget */
.upload-progress-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 2000;
    overflow: hidden;
    font-family: inherit;
    transition: all 0.3s ease;
}

.upload-progress-header {
    background-color: #4f46e5;
    color: #ffffff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-progress-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.upload-progress-close:hover {
    opacity: 1;
}

.upload-progress-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.upload-progress-row {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.upload-progress-row:last-child {
    border-bottom: none;
}

.upload-progress-file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    margin-bottom: 6px;
    color: #374151;
}

.upload-progress-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    font-weight: 500;
}

.upload-progress-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
}

.upload-progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #10b981;
    border-radius: 9999px;
    transition: width 0.1s linear;
}

.upload-progress-bar.error {
    background-color: #ef4444;
}

.upload-progress-bar.success {
    background-color: #10b981;
}
