@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --nx-primary: #6366f1;
    --nx-primary-hover: #4f46e5;
    --nx-bg: #f8fafc;
    --nx-sidebar-bg: rgba(255, 255, 255, 0.7);
    --nx-card-bg: rgba(255, 255, 255, 0.8);
    --nx-border: rgba(226, 232, 240, 0.8);
    --nx-text-main: #1e293b;
    --nx-text-muted: #64748b;
    --nx-text-dim: #94a3b8; /* Added for login styles */
    --nx-glass-border: rgba(255, 255, 255, 0.2);
    --nx-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --nx-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

#nexivo-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--nx-text-main);
    background: var(--nx-bg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--nx-shadow-lg);
    display: flex;
    min-height: 600px;
    border: 1px solid var(--nx-border);
    margin: 20px 0;
}

/* Sidebar */
.nx-sidebar {
    width: 260px;
    background: var(--nx-sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--nx-border);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nx-sidebar-item {
    padding: 14px 20px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--nx-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.nx-sidebar-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--nx-primary);
    transform: translateX(4px);
}

.nx-sidebar-item.active {
    background: var(--nx-primary);
    color: white;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.5);
}

/* Main Content */
.nx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    background: white;
    overflow-y: auto;
}

.nx-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 24px;
}

.nx-breadcrumb-container {
    margin-bottom: 32px;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid var(--nx-border);
}

#nexivo-breadcrumbs {
    font-size: 0.95rem;
    color: var(--nx-text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap; /* Allow wrapping for long paths */
    line-height: 1.6;
}

#nexivo-breadcrumbs span {
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

#nexivo-breadcrumbs span:hover {
    color: var(--nx-primary);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#nexivo-breadcrumbs .nx-separator {
    color: #cbd5e1;
    cursor: default;
    padding: 0 2px;
}

#nexivo-breadcrumbs .nx-separator:hover {
    background: none;
    box-shadow: none;
}

.nx-actions {
    display: flex;
    gap: 14px;
}

/* Buttons */
#nexivo-upload-btn,
#nexivo-new-folder,
.nx-btn-primary {
    background: var(--nx-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#nexivo-upload-btn:hover,
.nx-btn-primary:hover {
    background: var(--nx-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

#nexivo-new-folder {
    background: white;
    color: var(--nx-text-main);
    border: 1.5px solid var(--nx-border);
}

#nexivo-new-folder:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Storage Bar */
#nexivo-storage {
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px 24px;
    border-radius: 18px;
    border: 1px solid var(--nx-border);
}

.nx-storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--nx-text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}

.nx-storage-bar-container {
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.nx-storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alerts */
#nexivo-alerts {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white; /* Optional: cover content behind */
}

.nx-alert {
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 9999;
    min-height: 50px;
    animation: nx-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nx-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.nx-alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

@keyframes nx-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Browser Grid */
#nexivo-browser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.nexivo-folder,
.nexivo-file {
    background: white;
    border: 1px solid var(--nx-border);
    border-radius: 20px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nexivo-folder:hover,
.nexivo-file:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08);
    border-color: var(--nx-primary);
}

.nexivo-folder span,
.nexivo-file span {
    font-weight: 600;
    margin-top: 14px;
    font-size: 0.95rem;
    color: var(--nx-text-main);
    word-break: break-all;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nx-item-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 12px;
}

.nx-item-icon svg,
.nx-item-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Remove old flat colors as SVGs now have complex inline gradients */
.nexivo-folder:hover .nx-item-icon,
.nexivo-file:hover .nx-item-icon {
    transform: scale(1.08) translateY(-2px);
}

/* Item Meta (Size) */
.nx-item-size {
    font-size: 0.8rem;
    color: var(--nx-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* Actions in grid */
.nx-item-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    gap: 6px;
    transform: translateY(-4px);
}

.nexivo-folder:hover .nx-item-actions,
.nexivo-file:hover .nx-item-actions {
    opacity: 1;
    transform: translateY(0);
}

.nx-icon-btn {
    background: white;
    border: 1.5px solid var(--nx-border);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--nx-text-muted);
    transition: all 0.2s;
}

.nx-icon-btn:hover {
    color: var(--nx-primary);
    border-color: var(--nx-primary);
    background: #f5f3ff;
}

.nx-icon-btn.nx-btn-delete:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}

/* Modal Styling */
#nx-modal-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 9999;
}

#nexivo-share-modal {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 450px;
    z-index: 10000;
    display: none;
}

#nexivo-share-modal h3 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

#nexivo-share-modal p {
    color: var(--nx-text-muted);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.nx-modal-row label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--nx-text-main);
}

.nx-modal-row select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--nx-border);
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 0.95rem;
}

.nx-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.nx-btn-link {
    background: none;
    border: none;
    color: var(--nx-text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 12px 20px;
}

.nx-btn-link:hover {
    color: var(--nx-text-main);
}
/* Preview Modal */
#nx-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#nx-preview-modal {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#nx-preview-modal img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: block;
}

#nx-preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#nx-preview-close:hover {
    transform: scale(1.1);
}
/* Empty State */
.nx-empty-state {
    grid-column: 1 / -1;
    padding: 60px;
    text-align: center;
    color: var(--nx-text-muted);
}
/* Login Styles */
.nx-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.nx-login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

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

.nx-login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
    color: var(--nx-text-main);
}

.nx-login-header p {
    font-size: 0.9rem;
    color: var(--nx-text-muted);
}

.nx-form-group {
    margin-bottom: 20px;
}

.nx-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--nx-text-main);
}

.nx-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: white;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

.nx-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.nx-checkbox-label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nx-lost-pass {
    font-size: 0.85rem;
    color: var(--nx-primary);
    text-decoration: none;
}

.nx-lost-pass:hover {
    text-decoration: underline;
}

.nx-login-submit .nx-btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
}

/* Alert inside card */
.nx-login-card .nx-alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nx-alert.error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}
