:root {
    --md-sys-color-primary: #D0BCFF;
    --md-sys-color-on-primary: #381E72;
    --md-sys-color-primary-container: #4F378B;
    --md-sys-color-on-primary-container: #EADDFF;
    --md-sys-color-secondary: #CCC2DC;
    --md-sys-color-on-secondary: #332D41;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;
    --md-sys-color-background: #161517;
    --md-sys-color-on-background: #E6E1E5;
    --md-sys-color-surface: #1C1B1F;
    --md-sys-color-on-surface: #E6E1E5;
    --md-sys-color-surface-variant: #29282c;
    --md-sys-color-on-surface-variant: #CAC4D0;
    --md-sys-color-outline: #938F99;
}

/*
 * Global and typography styles
 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    font-size: 2.25rem;
    font-weight: 400;
    line-height: 2.75rem;
    color: var(--md-sys-color-on-background);
    text-align: center;
    margin: 0;
}

.subheader-bigger {
  text-align: center;
  font-size: 24px;
  line-height: 24px;
  color: var(--md-sys-color-secondary);
  margin-top: 0;
  margin-bottom: 24px;
}

.subheader {
  text-align: center;
  color: var(--md-sys-color-secondary);
}

.divider-solid {
  border-top: 3px solid var(--md-sys-color-primary);
  width: 120px;
  margin: 8px auto;
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 200,
  'GRAD' 0,
  'opsz' 8
}

/*
 * Main containers
 */
.container-wide {
    width: 100%;
    max-width: 1400px;
    background-color: var(--md-sys-color-surface);
    border-radius: 28px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--md-sys-color-surface);
    border-radius: 28px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/*
 * Form elements
 */
label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: background-color 0.3s, box-shadow 0.3s;
    resize: vertical;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    background-color: #5d5966;
    box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.7;
}

button {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    text-transform: uppercase;
}

.generate-button {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.generate-button:hover:not(:disabled) {
    background-color: #a68ce7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.generate-button:disabled {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    cursor: not-allowed;
}

/*
 * Wishlist updater specific styles
 */
.tabs {
    display: flex;
    justify-content: center;
    background-color: var(--md-sys-color-surface-variant);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 8px;
    gap: 4px;
}

.tab-button {
    flex-grow: 1;
    padding: 10px 24px;
    background: none;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}

.tab-button.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.tab-button:hover:not(.active) {
    background-color: rgba(204, 194, 220, 0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.input-group-wrapper {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background-color: #141416;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    gap: 8px;
}

.input-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group-row input, .input-group-row select {
  flex-grow: 1;
}

.input-group-row select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23CAC4D0'%3E%3Cpath d='M480-360 280-560h400L480-360Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.input-group-row > button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 1rem;
    border-radius: 12px;
    text-transform: none;
}

.input-group-row .add-input-button {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.input-group-row .remove-input-button {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.output-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.output-container #output-json {
  min-height: 200px;
}

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

#copy-button {
    width: 100%;
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

#copy-button:hover {
    background-color: #5d5966;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-message {
    font-size: 0.875rem;
    font-weight: 400;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#copy-status.status-message {
    opacity: 1;
}

.status-message.error {
    color: red;
}

/*
         * card-hoarder specific styles
         */
        
        .tab-sub-buttons {
            display: flex;
            justify-content: center;
            background-color: var(--md-sys-color-surface-variant);
            border-radius: 12px;
            padding: 4px;
            margin-bottom: 8px;
            gap: 4px;
        }

        .tab-sub-button {
            flex-grow: 1;
            padding: 10px 24px;
            background: none;
            border: none;
            color: var(--md-sys-color-on-surface-variant);
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 8px;
            transition: background-color 0.3s, color 0.3s;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tab-sub-button.active {
            background-color: var(--md-sys-color-secondary-container);
            color: var(--md-sys-color-on-secondary-container);
        }

        .tab-sub-button:hover:not(.active) {
            background-color: rgba(204, 194, 220, 0.08);
        }

        .form-section {
            display: none;
            flex-direction: column;
            gap: 16px;
        }

        .form-section.active {
            display: flex;
        }

        .form-row {
            display: flex;
            flex-direction: column;
            width: 50%;
            gap: 8px;
        }

/*
 * Filter section styles (for 20 Questions page)
 */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background-color: var(--md-sys-color-background);
    border-radius: 12px;
    padding: 24px;
}

.filter-group-item {
    flex-grow: 1;
    flex-basis: 0;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-input-duo {
    display: flex;
    gap: 8px;
}

/*
 * Table styles (for 20 Questions page)
 */
table {
    width: 100%;
    border: 1px solid var(--md-sys-color-primary-container);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    background-color: var(--md-sys-color-surface);
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

th {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 500;
    padding-top: 16px;
    padding-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

tbody tr:hover {
    background-color: var(--md-sys-color-surface-variant);
}

tbody tr:last-child td {
    border-bottom: none;
}

td a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

td a:hover {
    color: #a68ce7;
}

td.link-cell, th.link-cell {
  white-space: nowrap;
  min-width: 100px;
}

/*
 * Table buttons and icons (for 20 Questions page)
 */
table .visibility-btn {
  background: var(--md-sys-color-secondary-container);
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

table .visibility-btn:hover {
  background-color: rgba(204, 194, 220, 0.08);
  color: var(--md-sys-color-primary);
}

.hidden-row {
  color: var(--md-sys-color-outline);
  opacity: 0.3;
}

.hidden-row:hover {
  background-color: transparent !important;
}

/* Checkbox styles - consistent with Material-inspired design */

.input-group-row input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 0 8px 0 0;
  border-radius: 4px;
  border: 2px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface-variant);
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s, border-color 0.3s;
}

.input-group-row input[type="checkbox"]:checked {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.input-group-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 10px;
  border: solid var(--md-sys-color-on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.input-group-row label {
  display: flex;
  align-items: center;
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
  gap: 4px;
  cursor: pointer;
}

.input-group-row input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

/*
 * Responsive adjustments
 */
@media (max-width: 600px) {
    .filter-group {
        flex-direction: column;
    }

    table th, table td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .container, .container-wide {
        padding: 16px;
    }

    h1 {
        font-size: 1.75rem;
    }

    button {
        width: 100%;
    }
}