/* Comments Panel styling to match new theme */
.comments-panel {
    position: fixed;
    right: 0;
    top: calc(var(--header-height) + var(--ribbon-height));
    bottom: 32px; /* Status bar */
    width: 320px;
    background: #fdfdfd;
    border-left: 1px solid #e2e8f0;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    padding: 20px;
    box-shadow: -4px 0 15px rgba(0,0,0,0.03);
}

.comments-panel.active {
    transform: translateX(0);
}

.comment-item {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.1s, box-shadow 0.1s;
}

.comment-item:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.comment-highlight {
    background-color: rgba(255, 193, 7, 0.3);
    border-bottom: 2px solid #ffc107;
}

/* Utilities */
.separator {
  width: 1px;
  height: 24px;
  background-color: var(--border-light);
  margin: 0 8px;
}

/* Drag and Drop Overlay */
.drop-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(37, 99, 235, 0.1);
  backdrop-filter: blur(2px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-content {
  background: white;
  border: 3px dashed var(--accent-color);
  border-radius: 16px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.drop-overlay-content svg {
  width: 64px;
  height: 64px;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.drop-overlay-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-overlay-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Micro-interactions */
button, .ribbon-tab, .outline-list li {
  transition: all 0.2s ease;
}

/* Scrollbar styles - auto-hide, show on hover */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

*:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar - thin and auto-hide */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*:hover {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

@media print {
  body {
    background: #ffffff;
    overflow: visible;
  }

  .sidebar,
  .app-header,
  .ribbon-container,
  .status-bar,
  .comments-panel {
    display: none !important;
  }

  .main-column {
    width: 100%;
  }

  .editor-viewport {
    padding: 0;
    background: #ffffff;
    overflow: visible;
  }

  .editor-page-wrapper {
    max-width: none;
    width: 100%;
    gap: 0;
  }

  .editor-ruler {
    display: none;
  }

  #editor {
    box-shadow: none;
    min-height: auto;
  }
}

/* Focus Mode */
body.focus-mode .sidebar,
body.focus-mode .app-header,
body.focus-mode .ribbon-container {
  display: none !important;
}

body.focus-mode .editor-viewport {
  padding: 0;
  background: var(--bg-app);
}

body.focus-mode .editor-page-wrapper {
  margin: 20px auto;
  box-shadow: none;
}

/* Update ribbon container for popover positioning */
.ribbon-container {
    position: relative;
}

/* Styling for Select clipping issue */
#font-size-select {
    width: 68px !important;
}

/* Color picker circular style */
input[type="color"].color-picker-wrapper {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: none;
}
input[type="color"].color-picker-wrapper::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"].color-picker-wrapper::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}
input[type="color"].color-picker-wrapper::-moz-color-swatch {
    border: none;
    border-radius: 50%;
    border: 1px solid var(--border-light);
}

/* More Tools Popover */
.tool-popover {
    position: absolute;
    top: 65px; /* Just below toolbar */
    right: 16px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 240px;
    z-index: 2000;
    padding: 6px;
    display: flex;
    flex-direction: column;
    transform-origin: top right;
    animation: popoverFadeIn 0.15s cubic-bezier(0.2, 0, 0, 1);
    pointer-events: auto !important;
}

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

.tool-popover[hidden] {
    display: none;
}

.popover-section {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-row {
    display: flex; 
    align-items: center;
}

.tool-btn-small {
    width: 24px;
    height: 24px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.tool-btn-small:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.popover-separator {
    height: 1px;
    background-color: var(--border-light);
    margin: 4px 0;
}

.popover-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    gap: 12px;
    transition: background-color 0.15s;
}

.popover-item:hover {
    background-color: var(--bg-hover);
}

.popover-item .icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    color: var(--text-secondary);
}
