/* ============================================================
   Company Portal Icons — Intune Integration Styles
   intune-integration.css
   ============================================================ */

/* ── Header: Sign-In Button ─────────────────────────────── */
.intune-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: rgba(91, 155, 213, 0.15);
  border: 1px solid rgba(91, 155, 213, 0.35);
  color: #fff;
  border-radius: 7px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.intune-header-btn:hover {
  background: rgba(91, 155, 213, 0.3);
  border-color: rgba(91, 155, 213, 0.55);
}
.intune-header-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Small spinner for button loading state */
.intune-spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: intuneSpin 0.6s linear infinite;
}

/* ── Header: User Info (signed in) ──────────────────────── */
.intune-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: intuneSlideIn 0.3s ease;
}
.intune-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(91, 155, 213, 0.12);
  border-radius: 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.intune-dot-online {
  width: 7px;
  height: 7px;
  background: #27ae60;
  border-radius: 50%;
  flex-shrink: 0;
}
.intune-user-name {
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}
.intune-user-email {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
}
.intune-signout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  padding: 5px 11px;
  border-radius: 5px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.intune-signout-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* ── Icon Card: Send to Intune Button ───────────────────── */
.intune-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  margin-top: 8px;
  background: #5b9bd5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: 100%;
}
.intune-send-btn:hover {
  background: #4a89c2;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(91, 155, 213, 0.3);
}

/* ── Modal Overlay ───────────────────────────────────────── */
.intune-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: all 0.25s ease;
}
.intune-modal-overlay.active {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

/* ── Modal ───────────────────────────────────────────────── */
.intune-modal {
  background: #fff;
  border-radius: 14px;
  width: 500px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}
.intune-modal-overlay.active .intune-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.intune-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(135deg, #2a3544, #1e2a38);
  color: #fff;
  border-bottom: 2px solid #5b9bd5;
}
.intune-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.intune-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.intune-modal-close:hover { background: rgba(255, 255, 255, 0.2); }

.intune-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

/* ── Modal Preview ───────────────────────────────────────── */
.intune-modal-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f7f8fa;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid #e5e8ec;
}
.intune-modal-preview img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  border: 1px solid #dee2e6;
}
.intune-preview-name {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.intune-preview-sub {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: #8e99a8;
  margin-top: 2px;
}

/* ── Search ──────────────────────────────────────────────── */
.intune-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.intune-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #d0d4da;
  border-radius: 7px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: #333;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.intune-search-input:focus {
  border-color: #5b9bd5;
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.15);
}
.intune-search-input::placeholder { color: #aab0b8; }

/* ── Buttons ─────────────────────────────────────────────── */
.intune-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 7px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.intune-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.intune-btn-search {
  background: #f0f2f5;
  color: #444;
  border: 1px solid #d0d4da;
}
.intune-btn-search:hover { background: #e5e8ec; }
.intune-btn-send {
  background: #5b9bd5;
  color: #fff;
  padding: 7px 16px;
  font-size: 12px;
  flex-shrink: 0;
}
.intune-btn-send:hover:not(:disabled) { background: #4a8ac4; }

/* ── App List ────────────────────────────────────────────── */
.intune-app-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e5e8ec;
  border-radius: 10px;
  background: #fff;
}
.intune-app-list::-webkit-scrollbar { width: 5px; }
.intune-app-list::-webkit-scrollbar-thumb { background: #d0d4da; border-radius: 3px; }

.intune-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
}
.intune-app-item:last-child { border-bottom: none; }
.intune-app-item:hover { background: #f7f8fa; }

.intune-app-icon img,
.intune-app-no-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.intune-app-icon img {
  background: #fff;
  border: 1px solid #e5e8ec;
  padding: 2px;
}
.intune-app-no-icon {
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #dee2e6;
}
.intune-app-info { flex: 1; min-width: 0; }
.intune-app-name {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intune-app-type {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  color: #868e96;
  margin-top: 2px;
}

/* ── Status ──────────────────────────────────────────────── */
.intune-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  margin-top: 14px;
}
.intune-status-loading { background: #e8f0fa; color: #5b9bd5; }
.intune-status-success { background: #d4edda; color: #155724; }
.intune-status-error { background: #f8d7da; color: #721c24; }

/* ── Loading / Empty / Error ─────────────────────────────── */
.intune-loading,
.intune-empty,
.intune-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: #868e96;
}
.intune-error { color: #dc3545; }

/* ── Spinner ─────────────────────────────────────────────── */
.intune-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(91, 155, 213, 0.25);
  border-top-color: #5b9bd5;
  border-radius: 50%;
  animation: intuneSpin 0.6s linear infinite;
  flex-shrink: 0;
}
@keyframes intuneSpin { to { transform: rotate(360deg); } }
@keyframes intuneSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Toast ───────────────────────────────────────────────── */
.intune-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 13px 22px;
  border-radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  z-index: 100000;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  color: #fff;
}
.intune-toast-visible { transform: translateY(0); opacity: 1; }
.intune-toast-success { background: #155724; }
.intune-toast-error { background: #721c24; }
.intune-toast-info { background: #5b9bd5; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 560px) {
  .intune-modal { width: 95vw; max-height: 90vh; }
  .intune-modal-body { padding: 14px; }
}