/* Dobby Writer Popup Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #FFFAF4;
  color: #000000;
  line-height: 1.4;
  min-height: 100vh;
}

.popup-container {
  width: 340px;
  min-height: 400px;
  background: #FFFAF4;
  border-radius: 12px;
  overflow: hidden;
}

/* Header */
.popup-header {
  background: linear-gradient(135deg, #EF4D32 0%, #fed18e 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.popup-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: dobby-shimmer 3s ease-in-out infinite;
}

@keyframes dobby-shimmer {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
  50% { transform: translateX(0%) translateY(0%) rotate(180deg); }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
  position: relative;
}

.dobby-logo-small {
  width: 24px;
  height: 24px;
  animation: dobby-float 2s ease-in-out infinite;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  border-radius: 4px;
}

@keyframes dobby-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.popup-title {
  color: #FFFAF4;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-buttons {
  display: flex;
  gap: 8px;
  z-index: 1;
  position: relative;
}

.header-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #FFFAF4;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.header-btn-icon {
  font-size: 12px;
}

/* Stats Section */
.stats-section {
  padding: 16px 20px;
  background: #FFF4E8;
  border-bottom: 1px solid #ECECEC;
  display: flex;
  justify-content: space-around;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #EF4D32;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: #9B9B9B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Global Toggle Section */
.global-toggle-section {
  padding: 16px 20px;
  background: #fed18e;
  border-bottom: 1px solid #ECECEC;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.global-toggle-section .toggle-info {
  flex: 1;
}

.toggle-description {
  display: block;
  font-size: 11px;
  color: #9B9B9B;
  margin-top: 2px;
}

/* Site Toggle Section */
.site-toggle-section {
  padding: 16px 20px;
  background: #FFFAF4;
  border-bottom: 1px solid #ECECEC;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-info {
  flex: 1;
}

.toggle-label {
  display: block;
  font-weight: 500;
  color: #000000;
  margin-bottom: 2px;
}

.current-site {
  font-size: 12px;
  color: #9B9B9B;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ECECEC;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFAF4;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
  background-color: #EF4D32;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Quick Actions Box */
.quick-actions-box {
  margin: 16px;
  padding: 16px;
  background: #FFF4E8;
  border-radius: 12px;
  border: 1px solid #ECECEC;
}

.quick-actions-box h3 {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin: 0 0 12px 0;
}

.actions-grid-compact {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.action-btn-compact {
  width: 100%;
  aspect-ratio: 1;
  background: #FFFAF4;
  border: 1px solid #ECECEC;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.action-btn-compact:hover {
  background: #EF4D32;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 77, 50, 0.2);
  border-color: #EF4D32;
}

.action-btn-compact:hover .action-icon {
  filter: brightness(0) invert(1);
}

.action-btn-compact .action-icon {
  font-size: 18px;
  transition: filter 0.2s ease;
}

.quick-actions-hint {
  margin: 0;
  font-size: 11px;
  color: #9B9B9B;
  text-align: center;
}

/* Quick Actions */
.quick-actions {
  padding: 16px 20px;
  background: #FFF4E8;
  border-bottom: 1px solid #ECECEC;
}

.quick-actions h3 {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn {
  background: #FFFAF4;
  border: 1px solid #ECECEC;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  color: #000000;
}

.action-btn:hover {
  background: #EF4D32;
  color: #FFFAF4;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 77, 50, 0.2);
}

.action-icon {
  font-size: 16px;
}

.action-text {
  font-size: 12px;
  font-weight: 500;
}

/* Status Bar */
.status-bar {
  padding: 12px 20px;
  background: #FFFAF4;
  border-top: 1px solid #ECECEC;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fed18e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(254, 209, 142, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(254, 209, 142, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(254, 209, 142, 0);
  }
}

.status-text {
  color: #9B9B9B;
  font-weight: 500;
}

/* Animations */
.popup-container {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.loading .status-dot {
  background: #EF4D32;
}

.success .status-dot {
  background: #fed18e;
}

.error .status-dot {
  background: #EF4D32;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: #FFFAF4;
    color: #000000;
  }
  
  .popup-container {
    background: #FFFAF4;
  }
}

