:root {
  --primary-color: #4619c2;
  --primary-color-hover: #6447b5;
  --secondary-color: #2c3e50;
  --additional-color: #219150;
  --background-color: #f8f9fa;
  --text-color: #333333;
  --white: #ffffff;
  --black: #000000;
  --color-border: #ddd;
  --card-background: var(--white);
  --color-bg: var(--background-color);
  --color-text: var(--text-color);
  --color-card: var(--card-background);
  --color-accent: var(--primary-color);
  --color-accent-hover: var(--primary-color-hover);
  --color-default-fill: #c8aca5;
}

/* Dark theme overrides - using both media query and class-based approach */
@media (prefers-color-scheme: dark) {
  :root {
    --color-card: #23272e;
    --background-color: #181a20;
    --color-text: #f5f6fa;
    --color-border: #333842;
    --color-accent: var(--primary-color);
  }
}

/* Class-based theme overrides for explicit theme switching */
:root.dark,
[data-theme="dark"] {
  --color-card: #23272e;
  --background-color: #181a20;
  --color-text: #f5f6fa;
  --color-border: #333842;
  --color-accent: var(--primary-color);
}

:root.light,
[data-theme="light"] {
  --color-bg: #fff;
  --color-card: #f8f8f8;
  --background-color: #f8f9fa;
  --color-text: #333333;
  --color-border: #ddd;
  --color-accent: var(--primary-color);
  --color-default-fill: #524643;
}

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

:global(html),
:global(body) {
  background: var(--color-bg);
  color: var(--color-text);
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

button {
  cursor: pointer;
  padding: 0.5rem 1rem;
  background-color: var(--color-accent);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

button:hover {
  background-color: var(--color-accent-hover);
}

.view-toggle {
  display: flex;
  gap: 0.2rem;
}

.view-toggle button {
  padding: 0.3rem 0.5rem;
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-toggle button.active,
.view-toggle button:focus {
  background: var(--color-accent);
  color: var(--white);
  font-weight: bold;
  /* outline: 2px solid var(--color-border); */
}

.copy-btn,
.copy-group .png-btn {
  background-color: var(--secondary-color);
  color: var(--white);
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 2.5em;
  border-radius: 0;
  margin: 0;
  padding: 0.4em 1em;
  font-size: 0.95em;
  border-right: 1px solid var(--color-border);
  transition: background 0.2s, color 0.2s;
  text-wrap: nowrap;
}

.copy-btn:last-child,
.copy-group .png-btn:last-child {
  border-right: none;
}

.copy-btn:focus,
.copy-btn:hover,
.copy-group .png-btn:focus,
.copy-group .png-btn:hover {
  background: var(--black);
  color: var(--white);
  outline: none;
}

.download-btn,
.download-group .png-btn {
  background: #27ae60;
  color: var(--white);
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 2.5em;
  border-radius: 0;
  margin: 0;
  padding: 0.4em 1em;
  font-size: 0.95em;
  border-right: 1px solid var(--color-border);
  transition: background 0.2s, color 0.2s;
}

.download-btn:last-child,
.download-group .png-btn:last-child {
  border-right: none;
}

.download-btn:focus,
.download-btn:hover,
.download-group .png-btn:focus,
.download-group .png-btn:hover {
  background: #219150;
  color: var(--white);
  outline: none;
}

.copy-group,
.download-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-right: 0.5em;
}

/* Universal Button Group Styles */
.button-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-card);
}

.button-group button {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.5em 0.7em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  position: relative;
}

.button-group button:last-child {
  border-right: none;
}

.button-group button:hover:not(.active) {
  background: var(--color-border);
  color: var(--color-text);
}

.button-group button.active {
  background: var(--color-accent);
  color: #fff;
  border-right-color: var(--color-accent);
}

.button-group button.active:hover {
  background: var(--color-accent-hover, #2980b9);
  border-right-color: var(--color-accent-hover, #2980b9);
}

.button-group button.active:last-child {
  border-right: none;
}

.logo-actions {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.logo-info {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--color-card);
  color: var(--color-text);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.logo-info h3 {
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

.logo-image,
.logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-card);
  color: var(--color-text);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

/* Logo image styles - used in multiple components */
.logo-preview img,
div.logo-image img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.logo-image svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  color: var(--color-default-fill);
}

/* Modal styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--color-card);
  color: var(--color-text) !important;
  border-radius: 8px;
  padding: 1rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border);
  transition: background 0.2s, color 0.2s;
}

.modal-content * {
  color: var(--color-text);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-text);
}

.modal-body {
  color: var(--color-text);
}

textarea {
  background-color: var(--background-color);
  color: var(--color-text);
}
