/* ═══════════════════════════════════════════════════════════════
   DRIVE COMMAND SYSTEM v1.0 — Premium Glassmorphism UI
   Mirrors Gmail Command CSS but with Drive teal/emerald theme
   ═══════════════════════════════════════════════════════════════ */

/* ─── COMMAND MENU (floating popup) ────────────────────────── */
.dv-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.dv-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.dv-menu {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(12px) scale(0.96);
    width: 420px;
    max-width: 92vw;
    max-height: 70vh;
    background: rgba(22, 22, 26, 0.92);
    backdrop-filter: blur(60px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dv-menu-overlay.open .dv-menu {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.dv-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dv-menu-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dv-menu-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.10));
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dv-menu-logo svg {
    width: 15px;
    height: 15px;
    color: #34d399;
}

.dv-menu-title {
    font-size: 0.88rem;
    font-weight: 650;
    color: #f0f0f3;
    letter-spacing: -0.2px;
}

.dv-menu-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(161, 161, 170, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dv-menu-close svg {
    width: 13px;
    height: 13px;
}

.dv-menu-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
}

.dv-menu-body {
    padding: 8px 10px 12px;
    overflow-y: auto;
    max-height: 55vh;
    scrollbar-width: none;
}

.dv-menu-body::-webkit-scrollbar {
    display: none;
}

.dv-cat {
    padding: 6px 8px 4px;
}

.dv-cat-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(161, 161, 170, 0.35);
    text-transform: uppercase;
    padding: 4px 0 6px;
}

.dv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.dv-item:hover {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.12);
}

.dv-item:active {
    transform: scale(0.98);
}

.dv-item-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s;
}

.dv-item:hover .dv-item-icon {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.08);
}

.dv-item-icon svg {
    width: 15px;
    height: 15px;
    color: rgba(161, 161, 170, 0.5);
    transition: color 0.2s;
}

.dv-item:hover .dv-item-icon svg {
    color: #34d399;
}

.dv-item-text {
    flex: 1;
    min-width: 0;
}

.dv-item-label {
    font-size: 0.8rem;
    font-weight: 550;
    color: #e4e4e7;
}

.dv-item-desc {
    font-size: 0.66rem;
    color: rgba(161, 161, 170, 0.4);
    margin-top: 1px;
}

.dv-item-arrow {
    color: rgba(161, 161, 170, 0.2);
    font-size: 0.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.dv-item:hover .dv-item-arrow {
    color: #34d399;
    transform: translateX(3px);
}

/* ─── INLINE RESULTS (rendered in chat) ────────────────────── */
.dv-results {
    background: rgba(22, 22, 26, 0.6);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 18px;
    margin: 8px 0;
    max-width: 620px;
    animation: dvSlideUp 0.35s ease both;
}

@keyframes dvSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dv-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dv-results-title {
    font-size: 0.82rem;
    font-weight: 650;
    color: #f0f0f3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dv-results-title svg {
    width: 16px;
    height: 16px;
    color: #34d399;
}

.dv-results-count {
    font-size: 0.68rem;
    color: rgba(161, 161, 170, 0.4);
    font-weight: 500;
}

/* ─── FILE CARD ────────────────────────────────────────────── */
.dv-file {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dv-file:hover {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.10);
}

.dv-file:last-child {
    margin-bottom: 0;
}

.dv-file-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dv-file-icon.pdf {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.dv-file-icon.doc {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.dv-file-icon.sheet {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.dv-file-icon.slide {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.15);
}

.dv-file-icon.image {
    background: rgba(168, 85, 247, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.dv-file-icon.video {
    background: rgba(236, 72, 153, 0.1);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

.dv-file-icon.folder {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.dv-file-icon.other {
    background: rgba(161, 161, 170, 0.08);
    color: #a1a1aa;
    border: 1px solid rgba(161, 161, 170, 0.1);
}

.dv-file-info {
    flex: 1;
    min-width: 0;
}

.dv-file-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e4e4e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dv-file-meta {
    font-size: 0.65rem;
    color: rgba(161, 161, 170, 0.4);
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.dv-file-meta span {
    white-space: nowrap;
}

.dv-file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.dv-file-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(161, 161, 170, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.dv-file-btn:hover {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

/* ─── STAT GRID ────────────────────────────────────────────── */
.dv-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.dv-stat {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.dv-stat:hover {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.10);
}

.dv-stat-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0f0f3;
}

.dv-stat-label {
    font-size: 0.65rem;
    color: rgba(161, 161, 170, 0.45);
    font-weight: 500;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dv-stat-green .dv-stat-num {
    color: #34d399;
}

.dv-stat-blue .dv-stat-num {
    color: #60a5fa;
}

.dv-stat-amber .dv-stat-num {
    color: #fbbf24;
}

.dv-stat-purple .dv-stat-num {
    color: #a78bfa;
}

.dv-stat-red .dv-stat-num {
    color: #f87171;
}

/* ─── AI SUMMARY CARD ──────────────────────────────────────── */
.dv-summary {
    background: rgba(22, 22, 26, 0.6);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    margin: 8px 0;
    max-width: 600px;
    animation: dvSlideUp 0.35s ease both;
}

.dv-summary-title {
    font-size: 0.88rem;
    font-weight: 650;
    color: #f0f0f3;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dv-summary-title svg {
    width: 18px;
    height: 18px;
    color: #34d399;
}

.dv-summary-text {
    font-size: 0.78rem;
    color: rgba(228, 228, 231, 0.7);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── CLEANUP SUGGESTIONS ──────────────────────────────────── */
.dv-cleanup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}

.dv-cleanup-item:hover {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.08);
}

.dv-cleanup-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.dv-cleanup-info {
    flex: 1;
}

.dv-cleanup-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e4e4e7;
}

.dv-cleanup-desc {
    font-size: 0.66rem;
    color: rgba(161, 161, 170, 0.4);
    margin-top: 2px;
}

.dv-cleanup-size {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── SECTION HEADERS ──────────────────────────────────────── */
.dv-section-header {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: rgba(161, 161, 170, 0.35);
    text-transform: uppercase;
    margin: 14px 0 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dv-section-header:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* ─── LOADING ──────────────────────────────────────────────── */
.dv-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.78rem;
    color: rgba(161, 161, 170, 0.5);
}

.dv-spin {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(16, 185, 129, 0.15);
    border-top-color: #34d399;
    border-radius: 50%;
    animation: dvSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes dvSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── TOAST ────────────────────────────────────────────────── */
.dv-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 600;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 550;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-width: 360px;
}

.dv-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.dv-toast-success {
    background: #16a34a;
}

.dv-toast-error {
    background: #dc2626;
}

.dv-toast-warning {
    background: #d97706;
}

.dv-toast-info {
    background: #0ea5e9;
}

/* ─── EMPTY STATE ──────────────────────────────────────────── */
.dv-empty {
    text-align: center;
    padding: 24px 20px;
    color: rgba(161, 161, 170, 0.4);
    font-size: 0.78rem;
}

.dv-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* ─── TIMELINE ─────────────────────────────────────────────── */
.dv-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    position: relative;
}

.dv-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    margin-top: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.dv-timeline-content {
    flex: 1;
}

.dv-timeline-title {
    font-size: 0.76rem;
    font-weight: 550;
    color: #e4e4e7;
}

.dv-timeline-time {
    font-size: 0.62rem;
    color: rgba(161, 161, 170, 0.35);
    margin-top: 1px;
}

/* ─── IMPORTANT BADGE ──────────────────────────────────────── */
.dv-important-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.dv-badge-id {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.dv-badge-cert {
    background: rgba(168, 85, 247, 0.1);
    color: #a78bfa;
}

.dv-badge-bill {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
}

.dv-badge-resume {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.dv-badge-bank {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .dv-menu {
        width: 95vw;
        bottom: 70px;
    }

    .dv-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dv-results {
        padding: 14px;
        max-width: 100%;
    }
}