/* Breadcrumb */
.breadcrumb {
    margin-bottom: 16px;
    font-size: 15px;
    color: #374151;
    display: flex;
    gap: 8px;
    align-items: center;
}
.breadcrumb span {
    font-weight: 600;
}

.breadcrumb a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Action menu cho file */
.action-menu {
    position: relative;
    display: inline-block;
}
.action-menu-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    color: #374151;
}
.action-menu-btn:hover {
    background: #eef5ff;
}
.action-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15,23,42,0.13);
    z-index: 1000;
    padding: 8px 0;
}
.action-menu-dropdown.open {
    display: block;
}
.action-menu-dropdown a,
.action-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
}
.action-menu-dropdown a:hover,
.action-menu-dropdown button:hover {
    background: #eef5ff;
}
.action-menu-dropdown .delete-btn {
    color: #dc2626;
}
.action-menu-dropdown .delete-btn:hover {
    background: #fee2e2;
}
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: #1f2937;
    background:
        radial-gradient(circle at 20% 20%, rgba(80, 145, 255, 0.26), transparent 34%),
        radial-gradient(circle at 80% 10%, rgba(104, 85, 255, 0.18), transparent 35%),
        linear-gradient(145deg, #f3f8ff 0%, #e9f0fd 50%, #f6f7fb 100%);
}

button,
input,
select,
textarea {
    font-family: Arial, sans-serif;
}

.page-center {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.win11-card {
    width: min(430px, 100%);
    border-radius: 22px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(20, 50, 120, 0.12);
}

.title {
    margin: 0 0 8px;
    font-size: 29px;
    font-weight: 700;
    color: #111827;
}

.subtitle {
    margin: 0 0 22px;
    color: #4b5563;
    font-size: 14px;
}

.input-group {
    margin-bottom: 14px;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
    font-weight: 600;
}

.input-text,
.input-file {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.9);
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus,
.input-file:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 12px;
    padding: 11px 15px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #2f6cf2, #2056d8);
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.04);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border: 1px solid rgba(148, 163, 184, 0.4);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.message {
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 14px;
}

.message-success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.message-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.auth-link {
    margin-top: 16px;
    font-size: 14px;
    color: #4b5563;
}

.auth-link a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.container {
    max-width: 920px;
    margin: 38px auto;
    padding: 0 16px;
}

.drive-layout {
    max-width: 1220px;
    margin: 26px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.drive-sidebar {
    position: sticky;
    top: 16px;
}

.sidebar-title {
    margin: 0 0 14px;
    font-size: 22px;
}

.sidebar-link {
    display: block;
    margin-bottom: 8px;
    border-radius: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: #1f2937;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.7);
}

.sidebar-link.active {
    background: rgba(47, 108, 242, 0.14);
    border-color: rgba(47, 108, 242, 0.3);
    color: #1d4ed8;
    font-weight: 600;
}

.sidebar-meta {
    margin-top: 14px;
    border-top: 1px solid rgba(203, 213, 225, 0.9);
    padding-top: 10px;
    font-size: 14px;
    color: #4b5563;
}

.sidebar-logout {
    width: 100%;
    margin-top: 10px;
}

.drive-main {
    min-width: 0;
}

.upload-card {
    border-radius: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 14px 34px rgba(24, 43, 83, 0.1);
    margin-bottom: 18px;
    position: relative;
    overflow: visible;
}

.drive-main > .upload-card {
    z-index: 1;
}

.drive-main > .upload-card:first-child {
    z-index: 30;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.welcome {
    color: #374151;
    font-size: 14px;
}

.upload-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: center;
}

.menu-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.menu-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-weight: 600;
}

.menu-pill.active {
    background: rgba(255, 255, 255, 0.95);
}

.new-menu {
    position: relative;
    z-index: 50;
}

.new-button {
    border: none;
    border-radius: 10px;
    padding: 10px 13px;
    background: #dff0ff;
    color: #0f3b63;
    font-weight: 700;
    cursor: pointer;
}

.new-button:hover {
    filter: brightness(0.98);
}

.new-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 230px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16);
    padding: 10px 0;
    display: none;
    z-index: 2000;
}

.new-menu.open .new-dropdown {
    display: block;
}

.dropdown-label {
    margin: 2px 0 6px;
    padding: 0 14px;
    font-size: 12px;
    color: #6b7280;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 9px 14px;
    font-size: 16px;
    cursor: pointer;
    color: #1f2937;
}

.dropdown-item:hover {
    background: #eef5ff;
}

.dropdown-item.disabled,
.dropdown-item:disabled {
    color: #9ca3af;
    cursor: not-allowed;
    background: transparent;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
}

.hidden-form {
    display: none;
}

.hidden-form input[type="file"] {
    display: none;
}

.folder-create-panel {
    display: none;
    margin-top: 10px;
    gap: 10px;
    align-items: center;
}

.folder-create-panel.open {
    display: flex;
}

.folder-create-panel .input-text {
    max-width: 380px;
}

.search-form {
    width: 100%;
}

.search-form .input-text {
    height: 44px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
    font-size: 14px;
    vertical-align: middle;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-actions {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.bulk-actions.is-hidden {
    display: none;
}

.selected-count {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.selection-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    place-items: center;
}

.preview-modal.is-hidden {
    display: none;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
}

.preview-dialog {
    position: relative;
    width: min(92vw, 960px);
    max-height: 88vh;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-close {
    align-self: flex-end;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    background: #f8fafc;
    color: #1f2937;
    padding: 6px 10px;
    cursor: pointer;
}

.preview-close:hover {
    background: #eef2ff;
}

.preview-dialog img {
    width: 100%;
    max-height: calc(88vh - 58px);
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
}

.rename-input {
    width: 220px;
    height: 34px;
    padding: 6px 10px;
}

.checkbox-col {
    width: 42px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-small {
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.btn-danger {
    border: none;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
}

.btn-danger:hover {
    background: #b91c1c;
}

.empty {
    color: #6b7280;
}

@media (max-width: 640px) {
    .win11-card {
        padding: 20px;
    }

    .title {
        font-size: 25px;
    }

    .table,
    .table thead,
    .table tbody,
    .table tr,
    .table th,
    .table td {
        display: block;
    }

    .table th {
        display: none;
    }

    .table tr {
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(203, 213, 225, 0.8);
    }

    .table td {
        border: none;
        padding: 6px 0;
    }
}

@media (max-width: 980px) {
    .drive-layout {
        grid-template-columns: 1fr;
    }

    .drive-sidebar {
        position: static;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .folder-create-panel {
        flex-direction: column;
        align-items: stretch;
    }

}
