/* Module-specific styles for color-palette module */

/* Color swatches */
.module-color-palette .palette-color-preview {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row !important;
  padding: 18px !important;
  cursor: pointer; /* Add cursor pointer for clickable elements */
  position: relative; /* Add relative positioning for absolute child positioning */
}

/* Swatch group container styling */
.module-color-palette .swatch-group {
  overflow: hidden; /* Ensures the content doesn't overflow the rounded corners */
  border: 1px solid #e2e2e2;
}

/* Remove margins and borders between color swatches */
.module-color-palette .swatch-group > div > div {
  margin: 0 !important;
  border: none !important;
}

/* Ensure the entire area responds to clicks */
.module-color-palette .color-value {
  width: 100%; /* Extend to fill the available width */
  position: relative; /* For proper positioning of icon */
  cursor: pointer;
  display: flex; /* Use flexbox for row */
  justify-content: space-between; /* Places value on left, icon on right */
  align-items: center; /* Vertical centering */
  padding-right: 16px; /* Space for icon */
}

/* Copy icon styles */
.module-color-palette .copy-icon {
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: static;
  right: auto;
  top: auto;
  transform: none;
}

.module-color-palette .palette-color-preview:hover .copy-icon {
  opacity: 1;
}

@keyframes bounceInPalette {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.module-color-palette .palette-color-preview .copy-icon.animate {
  animation: bounceInPalette 0.25s ease forwards;
  opacity: 1 !important; /* Ensure visibility during animation */
  width: 20px;
  height: 20px;
}

/* Format navigation */
.format-navigation {
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e2e2;
  border-radius: 8px; /* Default value, will be overridden by inline style */
  background-color: #ffffff;
  position: relative;
  height: 44px;
  box-shadow: none;
  flex: 1;
  overflow: hidden;
}

.tab-controls {
  width: 40px;
  min-width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
  transition: opacity 0.3s;
  padding: 0;
}

.prev-btn {
  padding-left: 4px;
}

.next-btn {
  padding-right: 4px;
}

.tab-controls.hidden {
  display: none;
  width: 0;
  min-width: 0;
}

.tab-controls:disabled {
  opacity: 0.4;
  cursor: default;
}

.tab-control-inner {
  width: 28px;
  height: 28px;
  border-radius: 100%;
  background-color: #ffffff;
  border: 1px solid #A2A9B0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: none;
}

.tab-controls:not(:disabled):hover .tab-control-inner {
  background-color: var(--button-primary-color, #424242);
  border-color: var(--button-primary-color, #424242);
  box-shadow: none;
}

.tab-controls svg {
  width: 16px;
  height: 16px;
  fill: #A2A9B0;
  transition: fill 0.25s ease;
}

.tab-controls:not(:disabled):hover svg {
  fill: #ffffff;
}

.format-tabs-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  padding: 0;
}

.format-tabs {
  display: flex;
  width: 100%;
  height: 100%;
}

.format-tab {
  height: 100%;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  color: #757575;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  position: relative;
}

.format-tab:hover {
  color: var(--button-primary-color, #424242);
}

.format-tab.active {
  color: var(--button-primary-color, #424242);
  font-weight: 500;
  background-color: transparent;
  position: relative;
}

/* Active tab indicator (bottom line) */
.format-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--button-primary-color, #424242);
}

/* Dropdown styles */
.download-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e2e2;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  border-radius: 8px; /* Default value, will be overridden by inline style */
  padding: 0 2px;
}

.download-button:hover {
  background-color: var(--button-primary-color, #424242);
  transition: fill 0.2s ease;
}

.download-button svg {
  width: 18px;
  height: 18px;
  fill: #767676;
  margin: 0 2px;
}

.download-button:hover svg {
  fill: #ffffff;
}

.dropdown-menu-content {
  display: none;
  position: absolute;
  right: 14px;
  top: 48px;
  width: 240px;
  background: white;
  border-radius: 8px; /* Default value, will be overridden by JavaScript */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
  overflow: hidden;
  font-size: 14px;
}

.dropdown-menu-content.show {
  display: block;
}

.dropdown-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: none;
  font-size: 14px;
}

.dropdown-menu-item:last-child {
  border-bottom: none;
}

.dropdown-menu-item:hover {
  background-color: #f3f3f3;
}

.dropdown-menu-item .extension {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: white;
  font-size: 0.8em;
  color: #666;
}

.dropdown-divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 0;
}

.palette-color-card .palette-color-preview {
  width: 120px;
  height: 65px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.palette-color-card .palette-color-preview:hover {
  transform: scale(1.05);
}

.palette-color-card .copy-icon {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.3s ease;
  z-index: 2;
}

.palette-color-card .palette-color-preview:hover .copy-icon {
  opacity: 1;
}

/* Style for light backgrounds */
.palette-color-card .palette-color-preview.light-bg .copy-icon {
  color: rgba(0, 0, 0, 0.8);
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  padding: 4px;
}

/* Style for dark backgrounds */
.palette-color-card .palette-color-preview.dark-bg .copy-icon {
  color: rgba(255, 255, 255, 0.9);
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 4px;
}

.palette-color-card .copy-icon.animate {
  animation: icon-bounce 0.5s ease;
}

@keyframes icon-bounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Light/Dark background styles for regular palette-color-preview swatches */
.module-color-palette .palette-color-preview.light-bg .copy-icon {
  color: rgba(0, 0, 0, 0.75);
  fill: rgba(0, 0, 0, 0.75);
}

.module-color-palette .palette-color-preview.dark-bg .copy-icon {
  color: rgba(255, 255, 255, 0.95);
  fill: rgba(255, 255, 255, 0.95);
}

/* Hide any default tooltips related to copying */
.module-color-palette .clipboard-tooltip, 
.module-color-palette .copied-tooltip, 
.module-color-palette [data-tooltip="copied"],
.module-color-palette [data-clipboard-text]::after,
.module-color-palette [data-clipboard-text]::before,
.module-color-palette .palette-color-preview::after,
.module-color-palette .palette-color-preview::before,
.module-color-palette .color-preview::after,
.module-color-palette .color-preview::before {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

/* Override tippy.js tooltips for this module only */
.module-color-palette .tippy-box,
.module-color-palette .tippy-content,
.module-color-palette [class*="tippy"],
.module-color-palette [class*="tooltip"],
.module-color-palette [class*="clip"],
.module-color-palette .copy-feedback,
.module-color-palette div[style*="position: absolute"][style*="z-index: 999"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.module-color-palette .palette-color-preview .copy-icon svg {
  width: 18px;
  height: 18px;
}

.module-color-palette .palette-color-preview .copy-icon.animate svg {
  width: 20px;
  height: 20px;
}

/* Common styles for color palette module */
.module-color-palette .color-palette-content {
  max-width: 100%;
}

.module-color-palette .color-palette-tabs-content {
  max-width: 100%;
}

.module-color-palette .format-content {
  display: none;
}

.module-color-palette .format-content.active {
  display: block;
}

.module-color-palette .palette-name {
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--headings-color);
}

.module-color-palette .color-preview {
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-color-palette .color-preview:hover .copy-icon {
  opacity: 1;
}

.module-color-palette .copy-icon {
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: static;
  right: auto;
  top: auto;
  transform: none;
}

/* Custom styles for color-palette module */
.module-color-palette .color-palette-content {
  max-width: 100%;
}

.module-color-palette .color-palette-tabs-content {
  max-width: 100%;
}

.module-color-palette .nav-container {
  margin-bottom: 1.55rem;
}

.module-color-palette .format-navigation {
  max-width: calc(100% - 54px); /* 44px download button width + 10px gap */
}

.module-color-palette .palette-title {
  display: block;
  margin-bottom: 0;
  font-weight: 500;
}

/* Responsive improvements */
@media (max-width: 767.98px) {
  .module-color-palette .format-navigation {
    max-width: calc(100% - 54px);
  }
  
  .module-color-palette .format-tab {
    font-size: 0.85rem;
    padding: 0 8px;
  }
}

/* Mobile-specific styles */
@media (max-width: 576px) {
  .module-color-palette .format-navigation {
    max-width: calc(100% - 54px);
    min-width: 110px; /* Ensure minimum width for the navigation container */
  }
  
  .module-color-palette .format-tab {
    font-size: 0.85rem;
    padding: 0 8px;
    min-width: 60px; /* Ensure tabs have minimum width for proper display */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .module-color-palette .format-tabs-container {
    /* Ensure contents are centered in container */
    justify-content: center;
  }
  
  .module-color-palette .format-tab.active {
    /* Make active state more prominent on mobile */
    font-weight: 600;
  }
  
  .module-color-palette .tab-controls {
    width: 34px;
    min-width: 34px;
  }
  
  .module-color-palette .tab-control-inner {
    width: 24px;
    height: 24px;
  }
} 