/* ==========================================================================
   OCI File Server - Frontend Stylesheet (Milestone 3: Premium Aesthetics & Polish - R4)
   ========================================================================== */

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

:root {
  /* Dark Slate / Navy Palette with Radial Gradient Mesh Support */
  --bg-color: #0b0f19;
  --bg-radial-1: #1e1b4b;
  --bg-radial-2: #0f172a;
  --bg-radial-3: #070a12;

  /* Translucent Glass Card & Panel Variables */
  --card-bg: rgba(22, 31, 48, 0.72);
  --card-bg-hover: rgba(30, 41, 59, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-highlight: rgba(255, 255, 255, 0.16);
  --border-active: rgba(56, 189, 248, 0.45);
  --border-color: rgba(255, 255, 255, 0.1);
  
  /* Modern Typography Stack */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-family: var(--font-sans);

  /* Vibrant Gradient Accents */
  --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #3b82f6 50%, #8b5cf6 100%);
  --primary-gradient-hover: linear-gradient(135deg, #60a5fa 0%, #60a5fa 50%, #a855f7 100%);
  --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.2);
  --warning: #f59e0b;
  
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --glass-blur: 16px;
  
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --shadow-glow-primary: 0 0 20px rgba(56, 189, 248, 0.35);
  --shadow-main: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at 50% 0%, var(--bg-radial-1) 0%, var(--bg-radial-2) 45%, var(--bg-radial-3) 100%);
  background-attachment: fixed;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Floating Ambient Background Orbs
   -------------------------------------------------------------------------- */
.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  will-change: transform;
}

.orb-1 {
  top: -100px;
  left: -100px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #38bdf8 0%, #0284c7 70%, transparent 100%);
  animation: floatOrb1 20s ease-in-out infinite alternate, floatOrb 20s ease-in-out infinite alternate;
}

.orb-2 {
  bottom: -150px;
  right: -100px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #8b5cf6 0%, #4f46e5 70%, transparent 100%);
  animation: floatOrb2 25s ease-in-out infinite alternate;
}

.orb-3 {
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #06b6d4 0%, #0d9488 70%, transparent 100%);
  animation: floatOrb3 22s ease-in-out infinite alternate;
  opacity: 0.10;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.05); }
  100% { transform: translate(-20px, 50px) scale(0.95); }
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -60px) scale(1.05); }
  100% { transform: translate(40px, -30px) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-40%, -60%) scale(1.12); }
  100% { transform: translate(-60%, -40%) scale(0.9); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Header & Glass Containers
   -------------------------------------------------------------------------- */
.card, .app-header, .modal-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--card-border);
  border-top: 1px solid var(--card-border-highlight);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-glass), var(--shadow-glow-primary);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  margin-bottom: 28px;
}

.app-header:hover {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: var(--shadow-glass), 0 0 15px rgba(56, 189, 248, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  font-size: 1.65rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
  transition: transform 0.3s ease;
}

.brand:hover .logo-icon {
  transform: rotate(10deg) scale(1.1);
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Badges & Connection Status Pulse
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.725rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.badge-connected {
  background-color: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.15);
}

.badge-disconnected {
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

.badge-expires {
  background-color: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}

.badge-connected .status-dot {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseGlow 2s infinite ease-in-out;
}

.badge-disconnected .status-dot {
  background-color: #ef4444;
}

@keyframes pulseGlow {
  0% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.5; transform: scale(0.9); }
}

/* --------------------------------------------------------------------------
   Main Content & Card Styling
   -------------------------------------------------------------------------- */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  padding: 28px;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Buttons & Micro-Animations
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97) translateY(0);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #0b0f19;
  border-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-color);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #991b1b 100%);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-copied {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%) !important;
  color: #ffffff !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4) !important;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.spinning {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* --------------------------------------------------------------------------
   Form Inputs & Drag-and-Drop Area
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
  width: 100%;
  padding: 11px 16px;
  background-color: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
}

.form-group input:focus {
  border-color: var(--primary);
  background-color: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 0 12px rgba(56, 189, 248, 0.15);
}

.drag-over {
  border: 2px dashed var(--primary) !important;
  background: rgba(56, 189, 248, 0.1) !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25), inset 0 0 15px rgba(56, 189, 248, 0.15) !important;
}

/* --------------------------------------------------------------------------
   Modal Window
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-main), 0 0 30px rgba(56, 189, 248, 0.15);
  animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-top: 14px;
  margin-bottom: 14px;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

/* --------------------------------------------------------------------------
   Data Table
   -------------------------------------------------------------------------- */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: rgba(15, 23, 42, 0.4);
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

.data-table code {
  font-family: var(--font-mono);
  color: var(--primary);
  background-color: rgba(15, 23, 42, 0.6);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 0.825rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Command Generator Output Box
   -------------------------------------------------------------------------- */
.command-generator-box {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.command-generator-box h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.command-group {
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: rgba(9, 13, 22, 0.85);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.command-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background-color: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.command-group pre {
  padding: 14px 16px;
  margin: 0;
  overflow-x: auto;
  background: transparent;
}

.command-group code {
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Enhanced Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.15);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.toast-exit {
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast-msg {
  flex: 1;
}

.toast-success {
  border-left: 4px solid var(--success);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(34, 197, 94, 0.2);
}

.toast-danger,
.toast-error {
  border-left: 4px solid var(--danger);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(239, 68, 68, 0.2);
}

.toast-info {
  border-left: 4px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.2);
}

.toast-warning {
  border-left: 4px solid var(--warning);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(245, 158, 11, 0.2);
}

/* --------------------------------------------------------------------------
   Accessibility & Responsive Media Queries
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25) !important;
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }

  .auth-status {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    padding: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ambient-orb {
    display: none !important;
  }
}


