/* Variables */
:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-success: #16a34a;
    --color-warning: #d97706;

    --color-bg: #221d2d;
    --color-bg-card: #ffffff;
    --color-bg-sidebar: #1e293b;
    --color-bg-hover: #f1f5f9;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-light: #94a3b8;
    --color-text-inverse: #f8fafc;

    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    --transition: 150ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #221d2d
}

.login-box {
    background: linear-gradient(180deg, rgba(242, 235, 255, 0.16) 0%, rgba(242, 235, 255, 0.08) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    color:rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgb(231, 216, 255)
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 64px;
    height: 64px;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
}

.form-group input {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--color-text-light);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-radius: 30em;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(180deg, #f2ebff 24.09%, #e5d6ff 100%);
    box-shadow: 0px 1px 4px 0px rgb(0 0 0 / 40%);
    color: rgba(0, 0, 0, 0.8);
    
}

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

.btn-secondary {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

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

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

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-action {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--color-border);
}

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

.btn-action.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-border);
}

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

.btn-action svg {
    width: 16px;
    height: 16px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-error {
    background-color: #fef2f2;
    color: var(--color-danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #221d2d;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    color: #fff
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-small {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.app-title {
    font-size: 18px;
    font-weight: 600;
}

.app-content {
    display: flex;
    flex: 1;
}

.app-content-full {
    display: block;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--color-bg-sidebar);
    color: var(--color-text-inverse);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
    padding: 0 20px;
    margin-bottom: 12px;
}

.bucket-list {
    display: flex;
    flex-direction: column;
}

.bucket-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background-color var(--transition);
}

.bucket-item:hover a {
    background-color: rgba(255, 255, 255, 0.1);
}

.bucket-item.active a {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid var(--color-primary);
}

.bucket-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.bucket-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bucket-type {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--color-text-secondary);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(242, 235, 255, 0.16) 0%, rgba(242, 235, 255, 0.08) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    color:rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgb(231, 216, 255)
}

.breadcrumb-link {
    color:rgba(255, 255, 255, 0.8);
    transition: color var(--transition);
}

.breadcrumb-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color:rgba(255, 255, 255, 0.8);
}

.breadcrumb-current {
    color:rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

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

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-count {
    color: var(--color-text-secondary);
    font-size: 13px;
}

/* File List */
.file-list {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(242, 235, 255, 0.16) 0%, rgba(242, 235, 255, 0.08) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    color:rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgb(231, 216, 255)
}

.file-table {
    width: 100%;
}

.file-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    background: var(--color-bg-hover);
    border-bottom: 1px solid var(--color-border);
}

.file-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    color:rgba(255, 255, 255, 0.8);
}

.file-table tr:last-child td {
    border-bottom: none;
}

.file-row:hover {
    background-color: var(--color-bg-hover);
}
.file-row:hover *{
    color: #444 !important
}

.col-name {
    min-width: 50%;
}

.col-size {
    width: 15%;
}

.col-date {
    width: 20%;
}


.file-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text);
}

a.file-link:hover .file-name {
    color: var(--color-primary);
}

.file-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.file-icon svg {
    width: 100%;
    height: 100%;
}

.folder-icon {
    color: #fff;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition);
    color: #fff
}

.col-actions {
    display: flex;
    gap: 8px;
}

td.col-actions {
    display: table-cell;
}

td.col-actions > * {
    display: inline-flex;
    margin-right: 8px;
}

td.col-actions > *:last-child {
    margin-right: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

.text-danger {
    color: var(--color-danger);
    font-size: 13px;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .app-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
    }

    .bucket-list {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px;
        gap: 8px;
    }

    .bucket-item a {
        padding: 8px 12px;
        white-space: nowrap;
    }

    .bucket-type {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .file-table th:not(.col-name),
    .file-table td:not(.col-name):not(.col-actions) {
        display: none;
    }

    .col-name {
        width: auto;
    }
}
