:root {
  --accent-color: #ff5733;
  --accent-light: rgba(255, 87, 51, 0.1);
  --text-color: #ffffff;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --border-radius: 16px;
  --transition: all 0.3s ease;
  --dark-mode-bg: #121212;
  --dark-mode-card: #1e1e1e;
  --dark-mode-text: #f0f0f0;
  --dark-mode-secondary: #a0a0a0;
  --dark-mode-input: #2d2d2d;
  --dark-mode-border: #333;
  --icon-color: #555;
  --dark-mode-icon: #aaa;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: #333;
  line-height: 1.6;
  transition: background-color 0.5s ease, color 0.5s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6,
.channel-name,
.color-title,
.palette-title,
.harmony-title,
.export-title,
.history-title,
.modal-title {
  font-family: 'Poppins', sans-serif;
}

body.dark-mode {
  background-color: var(--dark-mode-bg);
  color: var(--dark-mode-text);
}

body.dark-mode .card-bg,
body.dark-mode .search-container,
body.dark-mode .channel-card,
body.dark-mode .color-card,
body.dark-mode .palette-container,
body.dark-mode .export-options,
body.dark-mode .history-container,
body.dark-mode .color-harmony {
  background-color: var(--dark-mode-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode .subtitle,
body.dark-mode .palette-description,
body.dark-mode .harmony-description {
  color: var(--dark-mode-secondary);
}

body.dark-mode input {
  background: var(--dark-mode-input);
  border-color: var(--dark-mode-border);
  color: var(--dark-mode-text);
}

body.dark-mode .color-value {
  background-color: var(--dark-mode-input);
}

body.dark-mode .example-chip {
  background: var(--dark-mode-input);
  color: var(--dark-mode-text);
}

body.dark-mode .example-chip:hover {
  background: #3d3d3d;
  box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.4);
}

body.dark-mode .palette-header,
body.dark-mode .harmony-header,
body.dark-mode .history-header,
body.dark-mode .modal-header {
  border-bottom: 1px solid var(--dark-mode-border);
}

body.dark-mode .color-label {
  color: var(--dark-mode-secondary);
}

body.dark-mode .history-item {
  border-bottom: 1px solid var(--dark-mode-border);
}

body.dark-mode .history-item:hover {
  background: #2a2a2a;
}

body.dark-mode .history-timestamp {
  color: var(--dark-mode-secondary);
}

body.dark-mode .history-color {
  border-color: var(--dark-mode-card);
}

body.dark-mode .error-message {
  background-color: rgba(231, 76, 60, 0.1);
}

body.dark-mode .css-code {
  background: var(--dark-mode-input);
}

body.dark-mode .palette-action-btn,
body.dark-mode .export-btn,
body.dark-mode .stat-badge {
  background: var(--dark-mode-input);
  color: var(--dark-mode-text);
}

body.dark-mode .palette-action-btn:hover,
body.dark-mode .export-btn:hover {
  background: #3d3d3d;
  box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.4);
}

body.dark-mode .scheme-title,
body.dark-mode .color-title {
  color: var(--dark-mode-text);
}

body.dark-mode .color-title i,
body.dark-mode .palette-title i,
body.dark-mode .harmony-title i,
body.dark-mode .export-title i,
body.dark-mode .history-title i,
body.dark-mode .scheme-title i,
body.dark-mode .stat-badge i,
body.dark-mode .export-btn i {
  color: var(--accent-color);
}

body.dark-mode h1 {
  color: #ffffff;
}

body.dark-mode input:focus {
  background: var(--dark-mode-input);
  box-shadow: 0 0 0 4px rgba(255, 87, 51, 0.2);
}

body.dark-mode .color-value:hover {
  background-color: #333;
}

body.dark-mode .profile-container {
  border-color: var(--dark-mode-card);
}

body.dark-mode .divider {
  color: var(--dark-mode-secondary);
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
  border-bottom: 1px solid var(--dark-mode-border);
}

body.dark-mode .upload-area {
  border-color: var(--dark-mode-border);
  background-color: rgba(255, 255, 255, 0.03);
}

body.dark-mode .upload-area:hover {
  border-color: var(--accent-color);
  background-color: rgba(255, 87, 51, 0.1);
}

body.dark-mode .upload-content i {
  color: var(--dark-mode-secondary);
}

body.dark-mode .upload-formats {
  color: var(--dark-mode-secondary);
}

body.dark-mode .uploaded-preview img {
  background-color: var(--dark-mode-input);
}

body.dark-mode .upload-content.drop-active p {
  color: var(--accent-color) !important;
}

body.dark-mode .upload-content.drop-active i {
  color: var(--accent-color) !important;
}

.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  transition: var(--transition);
  box-shadow: none;
}

.theme-toggle:hover {
  transform: rotate(15deg);
}

h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
  background: linear-gradient(90deg, #ff5733, #ff2d75);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.subtitle {
  font-size: 1.2rem;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
}

.search-container {
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: block;
}

.input-wrapper {
  position: relative;
  display: flex;
  margin-bottom: 1.5rem;
}

.input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  z-index: 2;
}

input {
  flex: 1;
  padding: 1.2rem 1rem 1.2rem 3rem;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 1rem;
  background: #f5f5f5;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: white;
  box-shadow: 0 0 0 4px var(--accent-light);
}

button {
  padding: 1rem 2rem;
  background-color: var(--accent-color);
  color: var(--text-color);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-left: 0.75rem;
}

button:hover {
  box-shadow: 0 6px 16px rgba(255, 87, 51, 0.4);
}

button:active {
  transform: translateY(0);
}

.examples {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border-radius: 50px;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
  transition: var(--transition);
}

.example-chip:hover {
  background: #e0e0e0;
  box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.4);
}

.example-chip i {
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #999;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #eee;
}

.divider span {
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.upload-container {
  margin-top: 0.5rem;
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background-color: rgba(0, 0, 0, 0.02);
}

.upload-area:hover {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
}

.upload-area.drag-over {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
  box-shadow: 0 0 0 4px rgba(255, 87, 51, 0.1);
  transform: scale(1.02);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-content i {
  font-size: 1.75rem;
  color: #aaa;
  margin-bottom: 0.25rem;
}

.upload-area:hover .upload-content i,
.upload-area.drag-over .upload-content i {
  color: var(--accent-color);
}

.upload-content p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.upload-formats {
  font-size: 0.75rem !important;
  color: #999;
  margin-top: 0.25rem !important;
}

.upload-content.drop-active p {
  font-size: 1.2rem !important;
  font-weight: 600 !important;
  color: var(--accent-color) !important;
}

.upload-content.drop-active .upload-subtitle,
.upload-content.drop-active .upload-formats,
.upload-content.drop-active .upload-btn {
  opacity: 0.5;
}

.upload-content.drop-active i {
  font-size: 3rem !important;
  color: var(--accent-color) !important;
  animation: pulse 1.5s infinite;
}

.uploaded-preview {
  display: none;
  position: relative;
  margin-top: 1rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
}

.uploaded-preview.visible {
  display: block;
}

.uploaded-preview img {
  width: 100%;
  display: block;
  max-height: 200px;
  object-fit: contain;
  background-color: #f5f5f5;
}

.remove-image {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
  margin: 0;
}

.remove-image:hover {
  background-color: rgba(231, 76, 60, 0.9);
  transform: scale(1.1);
}

.remove-image i {
  font-size: 0.9rem;
}

.results-container {
  display: none;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.results-container.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.custom-context-menu {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  padding: 8px 0;
  z-index: 1000;
  min-width: 150px;
}

body.dark-mode .custom-context-menu {
  background: var(--dark-mode-card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.context-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .context-menu-item {
  color: var(--dark-mode-text);
}

body.dark-mode .context-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.context-menu-item i {
  margin-right: 8px;
  color: var(--accent-color);
}

.channel-card {
  display: flex;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 3rem;
  transition: var(--transition);
}

.channel-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.channel-banner {
  position: relative;
  flex: 1;
  min-height: 220px;
  background: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
}

.channel-info {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-container {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: var(--transition);
}

.profile-container:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.channel-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  background: #f5f5f5;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
}

.stat-badge i {
  margin-right: 0.5rem;
  color: var(--accent-color);
}

.color-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.color-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  transition: var(--transition);
}

.color-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.color-preview {
  height: 180px;
  background-color: var(--accent-color);
  transition: background-color 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.color-preview-label {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.color-details {
  padding: 2rem;
}

.color-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.color-title i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.color-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.color-value {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 12px;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Monaco, Menlo, Consolas,
    monospace;
  font-size: 0.8rem;
  position: relative;
  transition: var(--transition);
}

.color-value:hover {
  background-color: #eaeaea;
}

.color-label {
  display: block;
  font-family: var(--body-font);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 0.25rem;
}

.copy-button {
  font-size: 0.75rem;
  color: var(--accent-color);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  box-shadow: none;
  float: right;
  min-width: 50px;
  text-align: center;
  position: relative;
}

.copy-button:hover {
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.palette-container {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 3rem;
  transition: var(--transition);
}

.palette-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.palette-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.palette-title-container {
  flex: 1;
}

.palette-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.palette-title i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.palette-description {
  margin-top: 0.5rem;
  color: #666;
}

.palette-actions {
  display: flex;
  gap: 0.5rem;
}

.palette-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: none;
}

.palette-action-btn:hover {
  background: #e0e0e0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.palette-action-btn i {
  margin-right: 0.5rem;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.palette-color {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.palette-color:hover {
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.palette-color-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.palette-color:hover .palette-color-content {
  transform: translateY(-100%);
}

.palette-color-hex {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.palette-color-index {
  font-size: 0.8rem;
  opacity: 0.8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.palette-color-copy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.palette-color:hover .palette-color-copy {
  transform: translateY(0);
}

.palette-color-copy i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.palette-color-copy-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.color-harmony {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 3rem;
  transition: var(--transition);
}

.color-harmony:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.harmony-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
}

.harmony-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.harmony-title i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.harmony-description {
  margin-top: 0.5rem;
  color: #666;
}

.harmony-schemes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

.harmony-scheme {
  display: flex;
  flex-direction: column;
}

.scheme-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.scheme-title i {
  margin-right: 0.5rem;
  color: var(--accent-color);
}

.scheme-colors {
  display: flex;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scheme-color {
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.scheme-color:hover {
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.scheme-color-copy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scheme-color:hover .scheme-color-copy {
  opacity: 1;
}

.scheme-color-copy i {
  font-size: 1.2rem;
}

.export-options {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 3rem;
  padding: 2rem;
  transition: var(--transition);
}

.export-options:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.export-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.export-title i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.export-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.palette-action-btn:hover,
.export-btn:hover {
  background: #e0e0e0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 77, 0, 0.4);
}

.export-btn i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  color: var(--accent-color);
}

.history-container {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  margin-bottom: 3rem;
  transition: var(--transition);
}

.history-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.history-header {
  padding: 2rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.history-title i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.clear-history {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: none;
  padding: 0.5rem 1rem;
}

.clear-history:hover {
  color: #ff5733;
  transform: none;
  box-shadow: none;
}

.history-items {
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.history-item:hover {
  background: #f5f5f5;
}

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

.history-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 1rem;
  flex-shrink: 0;
}

.history-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-info {
  flex: 1;
}

.history-channel-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.history-timestamp {
  font-size: 0.8rem;
  color: #999;
}

.history-colors {
  display: flex;
  margin-left: 1rem;
}

.history-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: -5px;
  border: 2px solid white;
}

.loading {
  display: none;
  justify-content: center;
  align-items: center;
  height: 100px;
  margin: 2rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 87, 51, 0.1);
  border-radius: 50%;
  border-left-color: var(--accent-color);
  animation: spin 1s linear infinite;
}

.error-message {
  display: none;
  background-color: #fff0f0;
  color: #e74c3c;
  border-left: 4px solid #e74c3c;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: var(--transition);
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.modal-close:hover {
  color: var(--accent-color);
  transform: none;
  box-shadow: none;
}

.modal-body {
  padding: 1.5rem;
}

.css-code {
  background: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Monaco, Menlo, Consolas,
    monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 1.5rem;
}

.copy-css-btn {
  display: block;
  width: 100%;
  text-align: center;
}

.footer {
  margin-top: 2rem;
  padding: 1rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color, #eaeaea);
}

.made-by {
  font-size: 0.9rem;
  color: var(--text-secondary, #666);
  transition: color 0.3s ease;
}

.made-by i {
  color: #ff5733;
  margin: 0 0.2rem;
}

.made-by a {
  font-weight: 600;
  color: var(--accent-color, #ff5733);
  text-decoration: none;
  transition: all 0.3s ease;
}

.made-by a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.dark-mode .made-by {
  color: var(--text-secondary-dark, #aaa);
}

.dark-mode .made-by a {
  color: var(--accent-color-dark, #ff7a5c);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  body {
    background-color: var(--dark-mode-bg);
    color: var(--dark-mode-text);
  }

  .card-bg,
  .search-container,
  .channel-card,
  .color-card,
  .palette-container,
  .export-options,
  .history-container,
  .color-harmony {
    background-color: var(--dark-mode-card);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  }

  .subtitle,
  .palette-description,
  .harmony-description {
    color: var(--dark-mode-secondary);
  }

  input {
    background: var(--dark-mode-input);
    border-color: var(--dark-mode-border);
    color: var(--dark-mode-text);
  }

  .color-value {
    background-color: var(--dark-mode-input);
  }

  .example-chip {
    background: var(--dark-mode-input);
    color: var(--dark-mode-text);
  }

  .palette-header,
  .harmony-header,
  .history-header,
  .modal-header {
    border-bottom: 1px solid var(--dark-mode-border);
  }

  .color-label {
    color: var(--dark-mode-secondary);
  }

  .history-item {
    border-bottom: 1px solid var(--dark-mode-border);
  }

  .history-timestamp {
    color: var(--dark-mode-secondary);
  }

  .history-color {
    border-color: var(--dark-mode-card);
  }

  .palette-action-btn,
  .export-btn,
  .stat-badge {
    background: var(--dark-mode-input);
    color: var(--dark-mode-text);
  }

  .theme-toggle {
    display: none;
  }

  .app-container {
    padding: 1rem;
  }

  .header {
    margin-bottom: 1.5rem;
    text-align: center;
  }

  h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #ff5733, #ff2d75);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .subtitle {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .search-container {
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  .input-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }

  .input-wrapper i {
    top: 1.65rem;
  }

  input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
  }

  input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 87, 51, 0.2);
  }

  button#analyzeBtn {
    width: 100%;
    margin: 0;
    margin-top: 0.75rem;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  .examples {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .examples::-webkit-scrollbar {
    display: none;
  }

  .example-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-right: 0.5rem;
    background: var(--dark-mode-input);
    color: var(--dark-mode-text);
  }

  .example-chip:hover {
    background: #3d3d3d;
  }

  .channel-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    flex-direction: column;
  }

  .channel-banner {
    min-height: 100px;
  }

  .profile-container {
    width: 80px;
    height: 80px;
    border-width: 3px;
    border-color: var(--dark-mode-card);
  }

  .channel-info {
    text-align: center;
    padding: 0.75rem 1rem 1.25rem;
  }

  .channel-name {
    font-size: 1.4rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    color: var(--dark-mode-text);
  }

  .channel-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .stat-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  .stat-badge i {
    color: var(--accent-color);
  }

  .color-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .color-card {
    border-radius: 12px;
    overflow: hidden;
  }

  .color-preview {
    height: 80px;
  }

  .color-details {
    padding: 1rem;
  }

  .color-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--dark-mode-text);
  }

  .color-title i {
    color: var(--accent-color);
  }

  .color-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .color-value {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .color-label {
    font-size: 0.7rem;
    margin-bottom: 0;
    margin-right: 0.5rem;
  }

  .copy-button {
    color: var(--accent-color);
  }

  .palette-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
  }

  .palette-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .palette-title {
    font-size: 1.1rem;
    color: var(--dark-mode-text);
  }

  .palette-title i {
    color: var(--accent-color);
  }

  .palette-description {
    font-size: 0.85rem;
    margin-top: 0.25rem;
  }

  .palette-actions {
    display: flex;
    width: 100%;
    margin-top: 0.75rem;
    gap: 0.5rem;
  }

  .palette-action-btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 6px;
  }

  .palette-action-btn:hover {
    background: #3d3d3d;
  }

  .palette-action-btn i {
    margin-right: 0.25rem;
  }

  .palette-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .palette-color-content {
    padding: 0.25rem;
  }

  .palette-color-hex {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .palette-color-index {
    font-size: 0.65rem;
  }

  .color-harmony {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
  }

  .harmony-header {
    padding: 1rem;
  }

  .harmony-title {
    font-size: 1.1rem;
    color: var(--dark-mode-text);
  }

  .harmony-title i {
    color: var(--accent-color);
  }

  .harmony-description {
    font-size: 0.85rem;
    margin-top: 0.25rem;
  }

  .harmony-schemes {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1rem;
  }

  .scheme-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-mode-text);
  }

  .scheme-title i {
    color: var(--accent-color);
  }

  .scheme-colors {
    height: 50px;
    border-radius: 6px;
  }

  .export-options {
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .export-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-mode-text);
  }

  .export-title i {
    color: var(--accent-color);
  }

  .export-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .export-btn {
    font-size: 0.85rem;
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    justify-content: center;
  }

  .export-btn:hover {
    background: #3d3d3d;
  }

  .export-btn i {
    margin-right: 0.5rem;
    color: var(--accent-color);
  }

  .history-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
  }

  .history-header {
    padding: 1rem;
    display: flex;
    align-items: center;
  }

  .history-title {
    font-size: 1.1rem;
    flex: 1;
    color: var(--dark-mode-text);
  }

  .history-title i {
    color: var(--accent-color);
  }

  .clear-history {
    position: relative;
    right: 0;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--dark-mode-secondary);
    box-shadow: none;
  }

  .clear-history:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
    transform: none;
    box-shadow: none;
  }

  .history-items {
    max-height: 300px;
    padding: 0;
  }

  .history-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--dark-mode-border);
  }

  .history-item:hover {
    background: #2a2a2a;
  }

  .history-thumbnail {
    width: 40px;
    height: 40px;
  }

  .history-channel-name {
    font-size: 0.9rem;
    color: var(--dark-mode-text);
  }

  .history-timestamp {
    font-size: 0.75rem;
  }

  .history-colors {
    display: flex;
  }

  .history-color {
    width: 15px;
    height: 15px;
    margin-left: -3px;
    border: 1px solid var(--dark-mode-card);
  }

  .modal-content {
    width: 92%;
    max-width: 92%;
    border-radius: 12px;
    background: var(--dark-mode-card);
  }

  .modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--dark-mode-border);
  }

  .modal-title {
    font-size: 1.1rem;
    color: var(--dark-mode-text);
  }

  .modal-close {
    color: var(--dark-mode-secondary);
  }

  .modal-body {
    padding: 1rem;
  }

  .css-code {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    background: var(--dark-mode-input);
    color: var(--dark-mode-text);
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
  }

  .error-message {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
  }

  .divider {
    margin: 1rem 0;
  }

  .upload-area {
    padding: 1rem 0.75rem;
  }

  .upload-content i {
    font-size: 1.5rem;
  }

  .upload-content p {
    font-size: 0.9rem;
  }

  .uploaded-preview img {
    max-height: 180px;
  }
}

@media (max-width: 480px) {
  .palette-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .export-buttons {
    grid-template-columns: 1fr;
  }

  .scheme-colors {
    height: 40px;
  }

  .upload-area {
    padding: 0.75rem 0.5rem;
  }

  .upload-content i {
    font-size: 1.25rem;
  }

  .upload-content p {
    font-size: 0.8rem;
  }

  .upload-formats {
    font-size: 0.65rem !important;
  }
}
