/* ==========================================================================
   MS WORD ONLINE - MODAL DIALOGS & POPUPS STYLES
   Find & Replace, Statistics, Page Setup, Symbol Picker, Shapes, Links, AI Settings
   ========================================================================== */

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: #e5e7eb;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  background-color: #f8f9fa;
  border-top: 1px solid #e5e7eb;
}

/* Form Controls in Modals */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-secondary);
}

.form-control {
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--ms-word-blue);
  box-shadow: 0 0 0 1px var(--ms-word-blue);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
}

/* Standard Modal Action Buttons */
.btn-dialog {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-dialog.primary {
  background-color: var(--ms-word-blue);
  color: #ffffff;
}

.btn-dialog.primary:hover {
  background-color: var(--ms-word-dark-blue);
}

.btn-dialog.secondary {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: var(--text-primary);
}

.btn-dialog.secondary:hover {
  background-color: #f3f4f6;
}

/* Statistics Table in Word Count Modal */
.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table td {
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
}

.stats-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--ms-word-blue);
}

/* Symbol & Shape Picker Grid */
.symbol-grid, .shapes-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.symbol-item, .shape-item {
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #ffffff;
  transition: all var(--transition-fast);
}

.shape-item svg {
  width: 22px;
  height: 22px;
  stroke: #185abd;
  fill: #e8f1fc;
}

.symbol-item:hover, .shape-item:hover {
  background-color: var(--ms-word-ultralight-blue);
  border-color: var(--ms-word-blue);
  color: var(--ms-word-blue);
}
