:root {
    --bg-color: #0f1115;
    --text-primary: #f0f2f5;
    --text-secondary: #a0a4ab;
    --glass-bg: rgba(25, 28, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #4f46e5;
    --accent-hover: #6366f1;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: sticky;
    top: 2rem;
    z-index: 10;
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); */
}

header {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.title-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a0a4ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.title-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hover-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 400px;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.hover-info {
    flex: 1;
    min-width: 0;
}

.hover-swatch {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: transparent;
    border: 3px solid var(--glass-border);
    transition: background-color 0.2s ease;
}

.hover-info h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hover-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.search-section {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    /* box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); */
}

.styled-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.styled-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.styled-select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

input[type="range"] {
    accent-color: var(--accent);
    height: 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    outline: none;
}

.value-display {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 600;
}

.reference-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: transparent;
    border: 3px solid var(--glass-border);
    transition: background-color 0.2s ease;
}

.reset-btn {
    padding: 0 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 44px;
    font-family: inherit;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.groups-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.group-container {
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    width: fit-content;
    overflow: hidden;
}

.group-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.group-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e; /* Darker text for readability on colored backgrounds */
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

.group-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-rgb-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.2);
}

.color-grid-8 {
    display: grid;
    grid-template-rows: repeat(8, 24px);
    grid-auto-columns: 24px;
    grid-auto-flow: column;
    gap: 4px;
    padding: 1rem;
}

.color-grid-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 1rem;
}

.color-tile {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    /* transition: transform 0.15s ease, z-index 0s, box-shadow 0.15s ease; */
    position: relative;
}

.color-tile:hover {
    transform: scale(2) !important;
    z-index: 100;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); */
    outline: 2px solid white;
}

.hidden {
    display: none !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    position: relative;
    max-width: 500px;
    width: 90%;
    margin: 0;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px) scale(0.95);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.modal-swatch {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--glass-border);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); */
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.modal-code, .modal-rgb {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.modal-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.modal-btn:hover {
    background: var(--accent-hover);
}


