/* ===================================================
   Kirin Doc Manager — Consolidated Styles
   =================================================== */

/* ---------- Base ---------- */
body {
    font-family: 'Karla', sans-serif;
    background: linear-gradient(135deg, #e0f2f1 0%, #e1f5fe 100%);
    color: #2c3e50;
    height: 100vh;
    overflow: hidden;
    margin: 0;
}

/* ---------- Brand ---------- */
.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.5px;
    background: -webkit-linear-gradient(45deg, #0288d1, #2e7d32);
    background: linear-gradient(45deg, #0288d1, #2e7d32);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Glass Panel ---------- */
.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    color: #2c3e50;
}

/* ---------- Sidebar ---------- */
.sidebar {
    height: calc(100vh - 60px);
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link {
    color: #546e7a;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(2, 136, 209, 0.1);
    color: #0288d1;
}

/* ---------- File Grid ---------- */
.file-grid {
    padding: 20px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* ---------- File Card ---------- */
.file-card {
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    color: #2c3e50;
    position: relative; /* Fixed stacking context */
}

.file-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    z-index: 10; /* Ensure hovered card stays above neighbors */
}

/* Fix: Card context menu overlap */
.file-card:has(.show) {
    z-index: 1080 !important;
}

/* ---------- Icons ---------- */
.file-icon {
    font-size: 2.5rem;
    color: #4fc3f7;
}

.folder-icon {
    font-size: 2.5rem;
    color: #81c784;
}

/* ---------- Pastel Button Overrides ---------- */
.btn-primary {
    background-color: #81d4fa;
    border-color: #81d4fa;
    color: #01579b;
}

.btn-primary:hover {
    background-color: #4fc3f7;
    border-color: #4fc3f7;
    color: #01579b;
}

/* ---------- Global Loader ---------- */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#global-loader.show {
    display: flex !important;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4fc3f7;
    animation: spin 1s ease-in-out infinite;
}

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

/* ---------- Utility ---------- */
.bg-pastel-blue {
    background-color: #b3d9ff;
    border-bottom: 1px solid #99ccff;
}

.file-size-label {
    font-size: 0.75rem;
}

.z-1000 {
    z-index: 1000 !important;
}
