/* ═══════════════════════════════════════════════════════════════════════════════
   SPACE DEEP THEME — SOP Cloud
   Full space blue background with stars, lava toxic progress bars
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Global Space Background ── */
#space-bg-global {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #050a1e 0%, #0a1535 25%, #0d1b40 45%, #0b1830 65%, #060c1f 85%, #030714 100%);
}

#space-bg-global canvas {
    width: 100%; height: 100%;
    display: block;
}

body {
    background: #050a1e !important;
    color: #c8daf0 !important;
}

/* Everything needs to sit above the canvas */
.loading-overlay,
.page-progress,
nav.navbar,
main,
footer,
.scroll-to-top,
.toast-container,
.modal {
    position: relative;
    z-index: 1;
}

main.container-fluid {
    background: transparent !important;
}

/* ── Navbar Space Theme ── */
nav.navbar {
    background: rgba(6,12,35,0.82) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(60,120,220,0.12) !important;
    box-shadow: 0 2px 30px rgba(0,20,80,0.4) !important;
}

nav.navbar .nav-link {
    color: #8aa8d0 !important;
    transition: color 0.3s ease;
}

nav.navbar .nav-link:hover,
nav.navbar .nav-link.active {
    color: #ffffff !important;
}

/* Colored icons on active page */
nav.navbar .nav-link.active i {
    color: #4fc3f7 !important;
    filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.5));
}

/* Colored icons on hover */
nav.navbar .nav-link:hover i {
    color: #4fc3f7 !important;
    filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.4));
    transition: color 0.3s ease, filter 0.3s ease;
}

nav.navbar .navbar-brand {
    color: #e0ecff !important;
}

nav.navbar .dropdown-menu {
    background: rgba(10,18,50,0.95) !important;
    border: 1px solid rgba(60,120,220,0.15) !important;
    backdrop-filter: blur(20px) !important;
}

nav.navbar .dropdown-item {
    color: #90b0d8 !important;
}

nav.navbar .dropdown-item:hover,
nav.navbar .dropdown-item:focus {
    background: rgba(40,80,180,0.2) !important;
    color: #a0d0ff !important;
}

nav.navbar .dropdown-divider {
    border-color: rgba(60,120,220,0.12) !important;
}

/* ── Page Progress Bar ── */
.page-progress {
    background: linear-gradient(90deg, #00ff88, #00e5ff, #7c4dff, #ff4081) !important;
    box-shadow: 0 0 15px rgba(0,229,255,0.5) !important;
}

/* ── Glass Cards (Global) ── */
.card,
.glass-card,
.bento-card,
.feature-card {
    background: rgba(10,18,45,0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(60,120,220,0.12) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0,20,80,0.25) !important;
    transition: all 0.3s ease !important;
    color: #c0d8f0 !important;
}

.card:hover,
.glass-card:hover,
.bento-card:hover {
    border-color: rgba(60,120,220,0.25) !important;
    box-shadow: 0 8px 40px rgba(0,30,120,0.3) !important;
}

.card-header,
.glass-card-header {
    background: rgba(255,255,255,0.03) !important;
    border-bottom: 1px solid rgba(60,120,220,0.1) !important;
    color: #c8daf0 !important;
}

.card-body {
    color: #b0c8e0 !important;
}

.card-title,
.card-header h5,
.card-header h6 {
    color: #d0e4ff !important;
}

/* ── Form Controls ── */
.form-control,
.form-select {
    background: rgba(8,16,40,0.7) !important;
    border: 1px solid rgba(60,120,220,0.15) !important;
    color: #d0e4ff !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

.form-control:focus,
.form-select:focus {
    background: rgba(12,22,55,0.85) !important;
    border-color: rgba(80,150,255,0.35) !important;
    box-shadow: 0 0 0 3px rgba(60,120,220,0.15) !important;
    color: #e0f0ff !important;
}

.form-control::placeholder {
    color: #506880 !important;
}

.form-label {
    color: #90b0d8 !important;
}

.form-check-input {
    background-color: rgba(20,40,80,0.6) !important;
    border-color: rgba(60,120,220,0.2) !important;
}

.form-check-input:checked {
    background-color: #2060c0 !important;
    border-color: #3080e0 !important;
}

.form-check-label {
    color: #90b0d8 !important;
}

/* ── Buttons ── */
.btn-primary,
.btn-navy,
.upload-main-btn {
    background: linear-gradient(135deg, #1a50a0 0%, #2a70d0 100%) !important;
    border: 1px solid rgba(80,150,255,0.25) !important;
    color: #fff !important;
    box-shadow: 0 4px 20px rgba(30,80,200,0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover,
.btn-navy:hover,
.upload-main-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2060b8 0%, #3585e8 100%) !important;
    box-shadow: 0 6px 30px rgba(40,100,220,0.45) !important;
    transform: translateY(-2px) !important;
}

.btn-primary:disabled,
.upload-main-btn:disabled {
    background: rgba(40,60,100,0.3) !important;
    border-color: rgba(60,100,160,0.15) !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
}

.btn-outline-secondary,
.btn-outline-info {
    border-color: rgba(60,120,220,0.2) !important;
    color: #80b0e0 !important;
    background: transparent !important;
}

.btn-outline-secondary:hover,
.btn-outline-info:hover {
    background: rgba(40,80,180,0.15) !important;
    border-color: rgba(60,120,220,0.35) !important;
    color: #a0d0ff !important;
}

.btn-outline-danger {
    border-color: rgba(220,60,80,0.3) !important;
    color: #ff6080 !important;
}

.btn-outline-danger:hover {
    background: rgba(200,40,60,0.15) !important;
    border-color: rgba(220,60,80,0.5) !important;
    color: #ff8090 !important;
}

.btn-icon {
    background: rgba(20,40,80,0.4) !important;
    border: 1px solid rgba(60,120,220,0.15) !important;
    color: #80b0e0 !important;
    border-radius: 10px !important;
}

.btn-icon:hover {
    background: rgba(30,60,120,0.5) !important;
    border-color: rgba(80,140,255,0.3) !important;
    color: #a0d0ff !important;
}

/* ── Upload Zone ── */
.upload-zone {
    background: rgba(8,16,40,0.4) !important;
    border: 3px dashed rgba(60,120,220,0.2) !important;
    border-radius: 20px !important;
    transition: all 0.4s ease !important;
}

.upload-zone:hover {
    background: rgba(15,30,70,0.5) !important;
    border-color: rgba(80,150,255,0.35) !important;
    box-shadow: 0 0 40px rgba(40,100,220,0.15) !important;
}

.upload-zone.dragover,
.upload-zone.drag-active {
    background: rgba(20,50,110,0.4) !important;
    border-color: rgba(80,160,255,0.5) !important;
    border-style: solid !important;
    box-shadow: 0 0 60px rgba(40,100,255,0.25) !important;
}

.upload-zone h3 {
    color: #c0d8f0 !important;
}

/* ── File Items ── */
.file-item {
    background: rgba(10,20,50,0.5) !important;
    border: 1px solid rgba(60,120,220,0.1) !important;
    border-radius: 12px !important;
}

.file-item:hover {
    background: rgba(15,30,70,0.6) !important;
    border-color: rgba(60,120,220,0.25) !important;
}

.file-item.uploading {
    border-color: rgba(80,150,255,0.3) !important;
}

.file-item.success {
    border-color: rgba(40,200,120,0.3) !important;
}

.file-item.error {
    border-color: rgba(220,60,80,0.3) !important;
}

.file-name {
    color: #d0e4ff !important;
}

.file-size {
    color: #7090b8 !important;
}

/* ── File Previews ── */
.file-preview {
    background: rgba(10,20,50,0.6) !important;
    border: 1px solid rgba(60,120,220,0.12) !important;
    border-radius: 12px !important;
}

.file-preview:hover {
    border-color: rgba(80,150,255,0.3) !important;
    box-shadow: 0 4px 20px rgba(30,80,200,0.2) !important;
}

.file-preview-name {
    color: #c0d8f0 !important;
}

.file-preview-size {
    color: #6888b0 !important;
}

.file-preview-icon {
    color: #5090d0 !important;
}

/* ── Accordion ── */
.accordion-button {
    background: rgba(10,20,50,0.5) !important;
    color: #b0c8e0 !important;
    border: 1px solid rgba(60,120,220,0.1) !important;
    border-radius: 10px !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(20,40,90,0.4) !important;
    color: #a0d0ff !important;
}

.accordion-body {
    background: rgba(6,12,35,0.6) !important;
    border: 1px solid rgba(60,120,220,0.08) !important;
    color: #90b0d8 !important;
}

/* ── Badges ── */
.badge {
    border-radius: 8px !important;
}

.badge.bg-primary {
    background: rgba(30,80,180,0.25) !important;
    border: 1px solid rgba(60,120,220,0.2);
    color: #70b0ff !important;
}

.badge.bg-info {
    background: rgba(30,160,220,0.2) !important;
    border: 1px solid rgba(60,180,240,0.2);
    color: #60d0ff !important;
}

.badge.bg-success {
    background: rgba(30,160,80,0.2) !important;
    border: 1px solid rgba(60,200,120,0.2);
    color: #50d8a0 !important;
}

.badge.bg-danger {
    background: rgba(200,40,60,0.2) !important;
    border: 1px solid rgba(220,60,80,0.2);
    color: #ff6080 !important;
}

.badge.bg-secondary {
    background: rgba(60,80,120,0.2) !important;
    border: 1px solid rgba(80,100,140,0.2);
    color: #8aa4c0 !important;
}

.badge.bg-warning {
    background: rgba(200,160,30,0.15) !important;
    border: 1px solid rgba(220,180,50,0.2);
    color: #f0c040 !important;
}

/* ── Text Overrides ── */
.text-muted {
    color: #5878a0 !important;
}

.text-white {
    color: #e8f0ff !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #d0e4ff;
}

/* ── Status Indicators ── */
.status-indicator {
    box-shadow: 0 0 8px currentColor !important;
}

.status-indicator.online {
    background: #30d080 !important;
    box-shadow: 0 0 10px rgba(48,208,128,0.5) !important;
}

.status-indicator.offline {
    background: #e04060 !important;
    box-shadow: 0 0 10px rgba(224,64,96,0.5) !important;
}

.status-indicator.warning {
    background: #e0a030 !important;
    box-shadow: 0 0 10px rgba(224,160,48,0.5) !important;
}

/* ── Breadcrumbs ── */
.breadcrumb {
    background: transparent !important;
}

.breadcrumb-item a {
    color: #5090d0 !important;
}

.breadcrumb-item.active {
    color: #6888a8 !important;
}

/* ── Alerts ── */
.alert {
    backdrop-filter: blur(15px) !important;
    border-radius: 12px !important;
}

.alert-success {
    background: rgba(30,160,80,0.15) !important;
    border-color: rgba(60,200,120,0.2) !important;
    color: #60d8a0 !important;
}

.alert-danger {
    background: rgba(200,40,60,0.15) !important;
    border-color: rgba(220,60,80,0.2) !important;
    color: #ff8090 !important;
}

.alert-warning {
    background: rgba(200,160,30,0.15) !important;
    border-color: rgba(220,180,50,0.2) !important;
    color: #f0c050 !important;
}

.alert-info {
    background: rgba(30,120,200,0.15) !important;
    border-color: rgba(60,150,220,0.2) !important;
    color: #60b0e8 !important;
}

/* ── Footer ── */
footer {
    background: rgba(6,10,25,0.85) !important;
    backdrop-filter: blur(15px) !important;
    border-top: 1px solid rgba(60,120,220,0.1) !important;
    color: #7090b8 !important;
}

footer h5, footer h6 {
    color: #a0c0e0 !important;
}

footer a.text-light {
    color: #7090b8 !important;
}

footer a.text-light:hover {
    color: #90b8e8 !important;
}

footer hr {
    border-color: rgba(60,120,220,0.1) !important;
}

footer p.text-light {
    color: #5878a0 !important;
}

/* ── Scroll to Top ── */
.scroll-to-top {
    background: rgba(20,50,120,0.8) !important;
    border: 1px solid rgba(60,120,220,0.2) !important;
    color: #80b8f0 !important;
    backdrop-filter: blur(10px) !important;
}

.scroll-to-top:hover {
    background: rgba(30,70,160,0.9) !important;
    box-shadow: 0 0 20px rgba(40,100,220,0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAVA TOXIC PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Overall progress container */
.progress {
    background: rgba(8,16,35,0.7) !important;
    border: 1px solid rgba(60,120,220,0.1);
    border-radius: 15px !important;
    overflow: hidden;
    position: relative;
}

/* Main lava toxic fill effect */
.progress-bar,
#overallProgressBar {
    background: linear-gradient(
        90deg,
        #00ff88 0%,
        #00e5ff 15%,
        #40ff40 30%,
        #00ffcc 45%,
        #00e5ff 55%,
        #7c4dff 70%,
        #ff4081 85%,
        #ff6e40 95%,
        #00ff88 100%
    ) !important;
    background-size: 300% 100% !important;
    animation: lava-toxic-flow 3s ease infinite !important;
    border-radius: 15px !important;
    box-shadow:
        0 0 15px rgba(0,255,136,0.4),
        0 0 30px rgba(0,229,255,0.2),
        inset 0 0 10px rgba(255,255,255,0.1) !important;
    position: relative;
    overflow: hidden;
    transition: width 0.4s ease !important;
}

/* Lava bubbles / shimmer overlay */
.progress-bar::before,
#overallProgressBar::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse 20px 15px at 20% 50%, rgba(255,255,255,0.25), transparent),
        radial-gradient(ellipse 15px 10px at 60% 30%, rgba(255,255,255,0.2), transparent),
        radial-gradient(ellipse 12px 12px at 80% 70%, rgba(255,255,255,0.15), transparent);
    animation: lava-bubbles 4s ease-in-out infinite;
}

/* Glowing toxic pulse */
.progress-bar::after,
#overallProgressBar::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0,255,200,0.3),
        rgba(0,229,255,0.4),
        rgba(0,255,200,0.3),
        transparent
    );
    animation: toxic-sweep 2.5s ease-in-out infinite;
}

@keyframes lava-toxic-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes lava-bubbles {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.6;
    }
    25% {
        transform: translateX(5%);
        opacity: 0.9;
    }
    50% {
        transform: translateX(-3%);
        opacity: 0.7;
    }
    75% {
        transform: translateX(8%);
        opacity: 1;
    }
}

@keyframes toxic-sweep {
    0%   { left: -60%; }
    100% { left: 120%; }
}

/* Progress text (percentage) readability */
.progress-text {
    position: relative;
    z-index: 2;
    color: #fff !important;
    text-shadow:
        0 0 8px rgba(0,255,136,0.6),
        0 1px 3px rgba(0,0,0,0.5) !important;
    font-weight: 700 !important;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* File-level progress bars */
.file-progress-bar {
    background: rgba(8,16,35,0.6) !important;
    border-radius: 6px !important;
    overflow: hidden;
    height: 10px !important;
}

.file-progress-fill {
    background: linear-gradient(
        90deg,
        #00ff88 0%,
        #00e5ff 25%,
        #40ff40 50%,
        #00ffcc 75%,
        #7c4dff 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: lava-toxic-flow 3s ease infinite !important;
    border-radius: 6px !important;
    box-shadow: 0 0 8px rgba(0,255,136,0.3) !important;
    position: relative;
    overflow: hidden;
}

.file-progress-fill::after {
    content: '' !important;
    position: absolute !important;
    top: 0; left: -100% !important;
    width: 60%; height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(0,255,200,0.4), transparent) !important;
    animation: toxic-sweep 2s ease-in-out infinite !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD SPECIFIC SPACE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.dashboard-container {
    background: transparent !important;
}

.dashboard-header h1 {
    background: linear-gradient(135deg, #e0ecff, #80b8f0) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Stat items */
.stat-item {
    background: rgba(10,20,50,0.4) !important;
    border-radius: 10px !important;
    padding: 10px;
}

.stat-value {
    color: #e0ecff !important;
}

.stat-label {
    color: #6888b0 !important;
}

/* Health Card Circles */
.circular-chart .circle-bg {
    stroke: rgba(60,120,220,0.1) !important;
}

.circular-chart .circle {
    stroke: #40a0ff !important;
    filter: drop-shadow(0 0 4px rgba(64,160,255,0.4));
}

.circular-chart .percentage {
    fill: #c0d8f0 !important;
}

.metric-label {
    color: #7090b8 !important;
}

/* Storage bar */
.storage-bar {
    background: rgba(8,16,35,0.6) !important;
    border-radius: 8px !important;
}

.storage-fill {
    background: linear-gradient(90deg, #00e5ff, #7c4dff) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0,229,255,0.3) !important;
}

.storage-labels .used {
    color: #60c8ff !important;
}

.storage-labels .total {
    color: #6888a8 !important;
}

/* Breakdown items */
.breakdown-label {
    color: #90a8c8 !important;
}

.breakdown-value {
    color: #c0d8f0 !important;
}

/* Detail rows */
.detail-label {
    color: #6888a8 !important;
}

.detail-value {
    color: #c0d8f0 !important;
}

/* Analytics card */
.analytics-card {
    background: rgba(10,18,45,0.7) !important;
}

/* Badge navy */
.badge-navy {
    background: rgba(30,80,180,0.2) !important;
    border: 1px solid rgba(60,120,220,0.2);
    color: #70b0ff !important;
    border-radius: 8px !important;
    padding: 4px 10px;
}

/* Quick stats */
.quick-stats .stat-item {
    border: 1px solid rgba(60,120,220,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   UPLOAD SPECIFIC SPACE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

.upload-container {
    background: transparent !important;
}

.upload-header h1 {
    background: linear-gradient(135deg, #e0ecff, #80b8f0) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Upload runner SVG space styling */
.upload-runner-svg {
    border: 1px solid rgba(60,120,220,0.2) !important;
    box-shadow: 0 4px 32px rgba(0,229,255,0.12), 0 0 0 1px rgba(0,229,255,0.06) !important;
    border-radius: 14px !important;
    background: rgba(6,13,31,0.8) !important;
}

.upload-runner-svg:hover {
    box-shadow: 0 8px 48px rgba(0,229,255,0.2), 0 0 0 1px rgba(0,229,255,0.12) !important;
}

/* Overall progress card */
#overallProgressContainer .card {
    background: rgba(10,20,45,0.7) !important;
    border: 1px solid rgba(60,120,220,0.12) !important;
}

/* Upload info card */
.upload-container .list-unstyled .bi-check-circle {
    color: #40d890 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY SPACE THEME
   ═══════════════════════════════════════════════════════════════════════════════ */

.loading-overlay {
    background: transparent !important;
    position: fixed !important;
    z-index: 9999 !important;
}

.loading-spinner {
    border-color: rgba(60,120,220,0.15) !important;
    border-top-color: #40a0ff !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.table {
    color: #b0c8e0 !important;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    border-bottom-color: rgba(60,120,220,0.08) !important;
    color: #b0c8e0 !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(30,60,120,0.15) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL SPACE THEME
   ═══════════════════════════════════════════════════════════════════════════════ */

.modal-content {
    background: rgba(10,18,45,0.95) !important;
    border: 1px solid rgba(60,120,220,0.15) !important;
    color: #c0d8f0 !important;
}

.modal-header {
    border-bottom-color: rgba(60,120,220,0.1) !important;
}

.modal-footer {
    border-top-color: rgba(60,120,220,0.1) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
    nav.navbar .navbar-collapse {
        background: rgba(8,14,40,0.95) !important;
        border-radius: 12px;
        padding: 16px;
        margin-top: 8px;
        border: 1px solid rgba(60,120,220,0.1);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SELECTION & SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════════ */

::selection {
    background: rgba(40,100,220,0.35);
    color: #e0f0ff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(6,12,30,0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(40,80,160,0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(50,100,200,0.5);
}
