/**
 * Rails Modal Manager - Complete Styles
 * Ported from @reshacs/react-modal-manager
 */

/* ============================================
   CSS Variables (Light Theme)
   ============================================ */
:root {
  /* Modal */
  --rmm-modal-bg: #ffffff;
  --rmm-modal-border: rgba(0, 0, 0, 0.1);
  --rmm-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --rmm-modal-radius: 12px;

  /* Overlay */
  --rmm-overlay-bg: rgba(0, 0, 0, 0.5);
  --rmm-overlay-blur: 0px;

  /* Header */
  --rmm-header-bg: #f8fafc;
  --rmm-header-border: rgba(0, 0, 0, 0.1);
  --rmm-header-text: #1e293b;
  --rmm-header-height: 56px;

  /* Footer */
  --rmm-footer-bg: #f8fafc;
  --rmm-footer-border: rgba(0, 0, 0, 0.1);
  --rmm-footer-text: #334155;
  --rmm-footer-height: 64px;

  /* Sidebar */
  --rmm-sidebar-bg: #f1f5f9;
  --rmm-sidebar-border: rgba(0, 0, 0, 0.1);
  --rmm-sidebar-width: 240px;
  --rmm-sidebar-collapsed-width: 64px;
  --rmm-sidebar-text: #334155;
  --rmm-sidebar-icon: #64748b;
  --rmm-sidebar-item-hover: rgba(0, 0, 0, 0.05);
  --rmm-sidebar-item-active-bg: rgba(59, 130, 246, 0.1);
  --rmm-sidebar-item-active-text: #3b82f6;

  /* Submenu */
  --rmm-submenu-bg: #f8fafc;
  --rmm-submenu-border: rgba(0, 0, 0, 0.1);
  --rmm-submenu-height: 48px;
  --rmm-submenu-item-text: #64748b;
  --rmm-submenu-item-hover: rgba(0, 0, 0, 0.05);
  --rmm-submenu-item-active-bg: #ffffff;
  --rmm-submenu-item-active-text: #3b82f6;

  /* Content */
  --rmm-content-bg: #ffffff;
  --rmm-content-text: #1e293b;

  /* Buttons */
  --rmm-btn-primary-bg: #3b82f6;
  --rmm-btn-primary-hover: #2563eb;
  --rmm-btn-primary-text: #ffffff;
  --rmm-btn-secondary-bg: #e2e8f0;
  --rmm-btn-secondary-hover: #cbd5e1;
  --rmm-btn-secondary-text: #334155;
  --rmm-btn-danger-bg: #ef4444;
  --rmm-btn-danger-hover: #dc2626;
  --rmm-btn-danger-text: #ffffff;
  --rmm-btn-success-bg: #22c55e;
  --rmm-btn-success-hover: #16a34a;
  --rmm-btn-success-text: #ffffff;
  --rmm-btn-warning-bg: #f59e0b;
  --rmm-btn-warning-hover: #d97706;
  --rmm-btn-warning-text: #ffffff;
  --rmm-btn-ghost-hover: rgba(0, 0, 0, 0.05);

  /* Taskbar */
  --rmm-taskbar-bg: #1e293b;
  --rmm-taskbar-height: 48px;
  --rmm-taskbar-item-bg: rgba(255, 255, 255, 0.1);
  --rmm-taskbar-item-hover: rgba(255, 255, 255, 0.2);
  --rmm-taskbar-item-text: #ffffff;

  /* Badge */
  --rmm-badge-bg: #ef4444;
  --rmm-badge-text: #ffffff;

  /* Resize */
  --rmm-resize-handle-size: 8px;
  --rmm-resize-handle-hover: rgba(59, 130, 246, 0.3);

  /* Animation */
  --rmm-animation-duration: 200ms;
  --rmm-animation-timing: cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --rmm-z-overlay: 2000;
  --rmm-z-modal: 2001;
  --rmm-z-taskbar: 2100;
}

/* ============================================
   Dark Theme
   ============================================ */
.dark {
  --rmm-modal-bg: #1e293b;
  --rmm-modal-border: rgba(255, 255, 255, 0.1);
  --rmm-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

  --rmm-overlay-bg: rgba(0, 0, 0, 0.7);

  --rmm-header-bg: #0f172a;
  --rmm-header-border: rgba(255, 255, 255, 0.1);
  --rmm-header-text: #f1f5f9;

  --rmm-footer-bg: #0f172a;
  --rmm-footer-border: rgba(255, 255, 255, 0.1);
  --rmm-footer-text: #e2e8f0;

  --rmm-sidebar-bg: #0f172a;
  --rmm-sidebar-border: rgba(255, 255, 255, 0.1);
  --rmm-sidebar-text: #e2e8f0;
  --rmm-sidebar-icon: #94a3b8;
  --rmm-sidebar-item-hover: rgba(255, 255, 255, 0.05);
  --rmm-sidebar-item-active-bg: rgba(59, 130, 246, 0.2);

  --rmm-submenu-bg: #0f172a;
  --rmm-submenu-border: rgba(255, 255, 255, 0.1);
  --rmm-submenu-item-text: #94a3b8;
  --rmm-submenu-item-hover: rgba(255, 255, 255, 0.05);
  --rmm-submenu-item-active-bg: #1e293b;

  --rmm-content-bg: #1e293b;
  --rmm-content-text: #f1f5f9;

  --rmm-btn-secondary-bg: #334155;
  --rmm-btn-secondary-hover: #475569;
  --rmm-btn-secondary-text: #f1f5f9;
  --rmm-btn-ghost-hover: rgba(255, 255, 255, 0.05);

  --rmm-taskbar-bg: #0f172a;
  --rmm-taskbar-item-bg: rgba(255, 255, 255, 0.1);
  --rmm-taskbar-item-hover: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Overlay
   ============================================ */
.rmm-overlay {
  position: fixed;
  inset: 0;
  background: var(--rmm-overlay-bg);
  z-index: var(--rmm-z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--rmm-animation-duration) var(--rmm-animation-timing),
              visibility var(--rmm-animation-duration) var(--rmm-animation-timing);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.rmm-overlay.rmm-active {
  opacity: 1;
  visibility: visible;
}

.rmm-overlay.rmm-overlay-blur {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rmm-overlay.rmm-overlay-passthrough {
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Modal Container
   ============================================ */
.rmm-modal {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: var(--rmm-modal-bg);
  border: 1px solid var(--rmm-modal-border);
  border-radius: var(--rmm-modal-radius);
  box-shadow: var(--rmm-modal-shadow);
  z-index: var(--rmm-z-modal);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(10px);
  transition: opacity var(--rmm-animation-duration) var(--rmm-animation-timing),
              visibility var(--rmm-animation-duration) var(--rmm-animation-timing),
              transform var(--rmm-animation-duration) var(--rmm-animation-timing);
  overflow: hidden;
  max-height: 90vh;
}

.rmm-modal.rmm-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Minimized state with fade animation */
.rmm-modal.rmm-minimized {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0.8) translateY(20px) !important;
  pointer-events: none !important;
}

/* Overlay minimized state */
.rmm-overlay.rmm-minimized {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Size variants */
.rmm-modal.rmm-size-xs { width: 30%; min-width: 280px; }
.rmm-modal.rmm-size-sm { width: 40%; min-width: 360px; }
.rmm-modal.rmm-size-md { width: 50%; min-width: 480px; }
.rmm-modal.rmm-size-lg { width: 60%; min-width: 600px; }
.rmm-modal.rmm-size-xl { width: 70%; min-width: 720px; }
.rmm-modal.rmm-size-full,
.rmm-modal.rmm-size-full.rmm-active,
.rmm-modal.rmm-size-full.rmm-position-center,
.rmm-modal.rmm-size-full.rmm-position-center.rmm-active,
.rmm-modal.rmm-size-full.rmm-position-top,
.rmm-modal.rmm-size-full.rmm-position-top.rmm-active,
.rmm-modal.rmm-size-full.rmm-position-bottom,
.rmm-modal.rmm-size-full.rmm-position-bottom.rmm-active {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-width: 100% !important;
  border-radius: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  margin: 0 !important;
}

/* Position variants */
.rmm-modal.rmm-position-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.rmm-modal.rmm-position-center.rmm-active {
  transform: translate(-50%, -50%) scale(1);
}

.rmm-modal.rmm-position-top {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.rmm-modal.rmm-position-top.rmm-active {
  transform: translateX(-50%) scale(1);
}

.rmm-modal.rmm-position-bottom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.rmm-modal.rmm-position-bottom.rmm-active {
  transform: translateX(-50%) scale(1);
}

.rmm-modal.rmm-position-top-left {
  top: 20px;
  left: 20px;
  transform: none;
}

.rmm-modal.rmm-position-top-right {
  top: 20px;
  right: 20px;
  transform: none;
}

.rmm-modal.rmm-position-bottom-left {
  bottom: 20px;
  left: 20px;
  transform: none;
}

.rmm-modal.rmm-position-bottom-right {
  bottom: 20px;
  right: 20px;
  transform: none;
}

/* ============================================
   Modal Header
   ============================================ */
.rmm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--rmm-header-height);
  min-height: var(--rmm-header-height);
  background: var(--rmm-header-bg);
  border-bottom: 1px solid var(--rmm-header-border);
  user-select: none;
  flex-shrink: 0;
}

.rmm-header.rmm-draggable {
  cursor: move;
}

.rmm-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.rmm-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--rmm-header-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rmm-header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rmm-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--rmm-header-text);
  opacity: 0.7;
  transition: opacity 0.15s, background-color 0.15s;
}

.rmm-header-btn:hover {
  opacity: 1;
  background: var(--rmm-btn-ghost-hover);
}

.rmm-header-btn.rmm-close-btn {
  width: calc(var(--rmm-header-height) + 1px);
  height: calc(var(--rmm-header-height) + 1px);
  border-radius: 0;
  margin: -1px -17px -1px 0;
}

.rmm-header-btn.rmm-close-btn:hover {
  background: #ef4444;
  color: white;
  opacity: 1;
}

.rmm-header-btn.rmm-close-btn svg {
  width: 22px;
  height: 22px;
}

.rmm-header-btn svg {
  width: 18px;
  height: 18px;
}

/* Custom header buttons */
.rmm-header-btn-custom {
  opacity: 0.8;
}

.rmm-header-btn-custom:hover {
  opacity: 1;
}

/* Header button variants */
.rmm-header-btn-danger {
  color: var(--rmm-btn-danger-bg);
}

.rmm-header-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--rmm-btn-danger-hover);
}

.rmm-header-btn-warning {
  color: var(--rmm-btn-warning-bg);
}

.rmm-header-btn-warning:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--rmm-btn-warning-hover);
}

.rmm-header-btn-success {
  color: var(--rmm-btn-success-bg);
}

.rmm-header-btn-success:hover {
  background: rgba(34, 197, 94, 0.15);
  color: var(--rmm-btn-success-hover);
}

.rmm-header-btn-info {
  color: var(--rmm-btn-primary-bg);
}

.rmm-header-btn-info:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--rmm-btn-primary-hover);
}

/* Text buttons in header */
.rmm-header-btn-text {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.rmm-header-btn-text.rmm-header-btn-primary {
  background: var(--rmm-btn-primary-bg);
  color: white;
  border-radius: 6px;
  margin: 0 4px;
}

.rmm-header-btn-text.rmm-header-btn-primary:hover {
  background: var(--rmm-btn-primary-hover);
}

.rmm-header-btn-text.rmm-header-btn-secondary {
  background: var(--rmm-btn-ghost-bg);
  color: var(--rmm-text-secondary);
  border-radius: 6px;
  margin: 0 4px;
}

.rmm-header-btn-text.rmm-header-btn-secondary:hover {
  background: var(--rmm-btn-ghost-hover);
  color: var(--rmm-text-primary);
}

.rmm-header-btn-label {
  white-space: nowrap;
}

/* Size controls dropdown */
.rmm-size-controls {
  position: relative;
}

.rmm-size-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--rmm-modal-bg);
  border: 1px solid var(--rmm-modal-border);
  border-radius: 8px;
  box-shadow: var(--rmm-modal-shadow);
  padding: 4px;
  min-width: 100px;
  z-index: 10;
  display: none;
}

.rmm-size-controls:hover .rmm-size-dropdown,
.rmm-size-dropdown:hover {
  display: block;
}

.rmm-size-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
  color: var(--rmm-header-text);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.rmm-size-option:hover {
  background: var(--rmm-btn-ghost-hover);
}

.rmm-size-option.rmm-active {
  background: var(--rmm-sidebar-item-active-bg);
  color: var(--rmm-sidebar-item-active-text);
}

/* Sidebar toggle button */
.rmm-sidebar-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.rmm-sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Modal Body
   ============================================ */
.rmm-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.rmm-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.rmm-content {
  flex: 1;
  overflow-y: auto;
  background: var(--rmm-content-bg);
  color: var(--rmm-content-text);
}

/* ============================================
   Modal Sidebar
   ============================================ */
.rmm-sidebar {
  width: var(--rmm-sidebar-width);
  min-width: var(--rmm-sidebar-width);
  background: var(--rmm-sidebar-bg);
  border-right: 1px solid var(--rmm-sidebar-border);
  display: flex;
  flex-direction: column;
  transition: width var(--rmm-animation-duration) var(--rmm-animation-timing),
              min-width var(--rmm-animation-duration) var(--rmm-animation-timing);
  overflow: hidden;
}

.rmm-sidebar.rmm-sidebar-collapsed {
  width: var(--rmm-sidebar-collapsed-width);
  min-width: var(--rmm-sidebar-collapsed-width);
}

.rmm-sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.rmm-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--rmm-sidebar-text);
  text-decoration: none;
  transition: background-color 0.15s;
  white-space: nowrap;
  /* Button reset for when using <button> */
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
}

.rmm-sidebar-item:hover {
  background: var(--rmm-sidebar-item-hover);
}

.rmm-sidebar-item.rmm-active {
  background: var(--rmm-sidebar-item-active-bg);
  color: var(--rmm-sidebar-item-active-text);
}

.rmm-sidebar-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--rmm-sidebar-icon);
}

.rmm-sidebar-item.rmm-active .rmm-sidebar-item-icon {
  color: var(--rmm-sidebar-item-active-text);
}

.rmm-sidebar-item-label {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rmm-sidebar-collapsed .rmm-sidebar-item {
  justify-content: center;
  padding: 10px;
}

.rmm-sidebar-collapsed .rmm-sidebar-item-label {
  display: none;
}

.rmm-sidebar-item-badge {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--rmm-badge-bg);
  color: var(--rmm-badge-text);
  border-radius: 10px;
}

.rmm-sidebar-collapsed .rmm-sidebar-item-badge {
  display: none;
}

/* Mobile sidebar overlay */
.rmm-sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .rmm-sidebar {
    position: absolute;
    top: var(--rmm-header-height);
    left: 0;
    bottom: 0;
    z-index: 10;
    width: var(--rmm-sidebar-width);
    min-width: var(--rmm-sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--rmm-animation-duration) var(--rmm-animation-timing);
  }

  .rmm-sidebar:not(.rmm-sidebar-collapsed) {
    transform: translateX(0);
  }

  .rmm-sidebar-overlay {
    display: block;
    position: absolute;
    inset: 0;
    top: var(--rmm-header-height);
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--rmm-animation-duration) var(--rmm-animation-timing),
                visibility var(--rmm-animation-duration) var(--rmm-animation-timing);
    z-index: 9;
  }

  .rmm-sidebar:not(.rmm-sidebar-collapsed) ~ .rmm-sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================
   Modal Submenu
   ============================================ */
.rmm-submenu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: var(--rmm-submenu-height);
  background: var(--rmm-submenu-bg);
  border-bottom: 1px solid var(--rmm-submenu-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.rmm-submenu::-webkit-scrollbar {
  height: 4px;
}

.rmm-submenu::-webkit-scrollbar-track {
  background: transparent;
}

.rmm-submenu::-webkit-scrollbar-thumb {
  background: var(--rmm-modal-border);
  border-radius: 2px;
}

.rmm-submenu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rmm-submenu-item-text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.rmm-submenu-item:hover {
  background: var(--rmm-submenu-item-hover);
}

.rmm-submenu-item.rmm-active {
  background: var(--rmm-submenu-item-active-bg);
  color: var(--rmm-submenu-item-active-text);
}

.rmm-submenu-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

/* ============================================
   Modal Footer
   ============================================ */
.rmm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--rmm-footer-height);
  min-height: var(--rmm-footer-height);
  background: var(--rmm-footer-bg);
  border-top: 1px solid var(--rmm-footer-border);
  flex-shrink: 0;
}

.rmm-footer-left {
  flex: 1;
  min-width: 0;
}

.rmm-footer-message {
  font-size: 14px;
  color: var(--rmm-footer-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rmm-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Buttons
   ============================================ */
.rmm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.rmm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rmm-btn-primary {
  background: var(--rmm-btn-primary-bg);
  color: var(--rmm-btn-primary-text);
}

.rmm-btn-primary:hover:not(:disabled) {
  background: var(--rmm-btn-primary-hover);
}

.rmm-btn-secondary {
  background: var(--rmm-btn-secondary-bg);
  color: var(--rmm-btn-secondary-text);
}

.rmm-btn-secondary:hover:not(:disabled) {
  background: var(--rmm-btn-secondary-hover);
}

.rmm-btn-danger {
  background: var(--rmm-btn-danger-bg);
  color: var(--rmm-btn-danger-text);
}

.rmm-btn-danger:hover:not(:disabled) {
  background: var(--rmm-btn-danger-hover);
}

.rmm-btn-success {
  background: var(--rmm-btn-success-bg);
  color: var(--rmm-btn-success-text);
}

.rmm-btn-success:hover:not(:disabled) {
  background: var(--rmm-btn-success-hover);
}

.rmm-btn-warning {
  background: var(--rmm-btn-warning-bg);
  color: var(--rmm-btn-warning-text);
}

.rmm-btn-warning:hover:not(:disabled) {
  background: var(--rmm-btn-warning-hover);
}

.rmm-btn-loading {
  position: relative;
  color: transparent !important;
}

.rmm-btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rmm-spin 0.6s linear infinite;
}

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

/* ============================================
   Resize Handles
   ============================================ */
.rmm-resize-handles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rmm-resize-handle {
  position: absolute;
  pointer-events: auto;
}

.rmm-resize-handle:hover {
  background: var(--rmm-resize-handle-hover);
}

/* Edge handles */
.rmm-resize-handle-n {
  top: 0;
  left: var(--rmm-resize-handle-size);
  right: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: ns-resize;
}

.rmm-resize-handle-s {
  bottom: 0;
  left: var(--rmm-resize-handle-size);
  right: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: ns-resize;
}

.rmm-resize-handle-e {
  right: 0;
  top: var(--rmm-resize-handle-size);
  bottom: var(--rmm-resize-handle-size);
  width: var(--rmm-resize-handle-size);
  cursor: ew-resize;
}

.rmm-resize-handle-w {
  left: 0;
  top: var(--rmm-resize-handle-size);
  bottom: var(--rmm-resize-handle-size);
  width: var(--rmm-resize-handle-size);
  cursor: ew-resize;
}

/* Corner handles */
.rmm-resize-handle-ne {
  top: 0;
  right: 0;
  width: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: nesw-resize;
}

.rmm-resize-handle-nw {
  top: 0;
  left: 0;
  width: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: nwse-resize;
}

.rmm-resize-handle-se {
  bottom: 0;
  right: 0;
  width: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: nwse-resize;
}

.rmm-resize-handle-sw {
  bottom: 0;
  left: 0;
  width: var(--rmm-resize-handle-size);
  height: var(--rmm-resize-handle-size);
  cursor: nesw-resize;
}

/* ============================================
   Taskbar
   ============================================ */
.rmm-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--rmm-taskbar-height);
  background: var(--rmm-taskbar-bg);
  z-index: var(--rmm-z-taskbar);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  transform: translateY(100%);
  transition: transform var(--rmm-animation-duration) var(--rmm-animation-timing);
}

.rmm-taskbar.rmm-taskbar-visible {
  transform: translateY(0);
}

.rmm-taskbar-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
}

.rmm-taskbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--rmm-taskbar-item-bg);
  border-radius: 6px;
  color: var(--rmm-taskbar-item-text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s;
}

.rmm-taskbar-item:hover {
  background: var(--rmm-taskbar-item-hover);
}

.rmm-taskbar-item-title {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rmm-taskbar-badge {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--rmm-btn-primary-bg);
  color: var(--rmm-btn-primary-text);
  border-radius: 8px;
}

.rmm-taskbar-item-restore,
.rmm-taskbar-item-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--rmm-taskbar-item-text);
  opacity: 0.7;
  transition: opacity 0.15s, background-color 0.15s;
}

.rmm-taskbar-item-restore:hover,
.rmm-taskbar-item-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.rmm-taskbar-item-close:hover {
  background: rgba(239, 68, 68, 0.3);
}

.rmm-taskbar-item-restore svg,
.rmm-taskbar-item-close svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .rmm-modal {
    width: calc(100% - 40px) !important;
    min-width: auto !important;
    max-width: none !important;
    left: 20px !important;
    right: 20px !important;
    transform: none !important;
  }

  .rmm-modal.rmm-position-center {
    top: 20px !important;
    bottom: 20px !important;
    max-height: calc(100% - 40px);
  }

  .rmm-modal.rmm-size-full {
    width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    max-height: 100%;
    border-radius: 0;
  }

  .rmm-header {
    cursor: default !important;
  }

  .rmm-resize-handles {
    display: none;
  }
}

/* ============================================
   Drag Handle
   ============================================ */
.rmm-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--rmm-header-text);
  opacity: 0.4;
  flex-shrink: 0;
  cursor: grab;
}

.rmm-header.rmm-draggable .rmm-drag-handle:hover {
  opacity: 0.7;
}

.rmm-drag-handle svg {
  width: 14px;
  height: 14px;
}

/* Hide drag handle on mobile */
@media (max-width: 768px) {
  .rmm-drag-handle {
    display: none;
  }
}

/* ============================================
   Utilities
   ============================================ */
.rmm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
