/* BDAPPS Multi-Account Master Dashboard CSS */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* App Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  margin: 0;
}

.sidebar-menu {
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.menu-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #475569;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.nav-link-custom:hover {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-link-custom.active {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: auto;
}

.status-dot.LOGGED_IN { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.LOGIN_REQUIRED { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.SESSION_EXPIRED { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.CONNECTING { background-color: var(--info); box-shadow: 0 0 8px var(--info); animation: pulse 1.5s infinite; }
.status-dot.ERROR { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-navbar {
  height: 70px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.page-heading {
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-dark);
}

.main-content {
  padding: 1.5rem;
  flex: 1;
}

/* Rounded Cards */
.card-custom {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.12);
}

/* Status Badges */
.badge-status {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-status.LOGGED_IN { background-color: #d1fae5; color: #065f46; }
.badge-status.LOGIN_REQUIRED { background-color: #fef3c7; color: #92400e; }
.badge-status.SESSION_EXPIRED { background-color: #ffedd5; color: #9a3412; }
.badge-status.CONNECTING { background-color: #cff4fc; color: #055160; }
.badge-status.ERROR { background-color: #fee2e2; color: #991b1b; }

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Interactive Remote Browser Viewport Container */
.browser-view-container {
  background-color: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  position: relative;
}

.browser-toolbar {
  background-color: #1e293b;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #334155;
  color: #fff;
}

.browser-url-bar {
  flex: 1;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.85rem;
  color: #94a3b8;
  font-size: 0.85rem;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-wrapper {
  position: relative;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  user-select: none;
}

#screencastCanvas {
  max-width: 100%;
  height: auto;
  cursor: default;
  display: block;
  outline: none;
}

#screencastCanvas:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

.canvas-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  z-index: 10;
}

/* Clipboard Alert Notice */
.clipboard-warning {
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.8rem;
  color: #873800;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Toast Notifications */
.toast-container-custom {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
}
