:root {
    --primary: #00B894;
    --primary-hover: #009A7A;
    --secondary: #55EFC4;
    --accent: #FDCB6E;
    --background: #0A1F1C;
    --surface: rgba(16, 42, 38, 0.6);
    --surface-border: rgba(0, 184, 148, 0.15);

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dark: #000000;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    background-image:
        radial-gradient(circle at top right, rgba(0, 184, 148, 0.05), transparent 60%),
        radial-gradient(circle at bottom left, rgba(85, 239, 196, 0.05), transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
}

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

/* Typography elements */
h1,
h2,
h3 {
    font-weight: 600;
    color: #FFF;
}

h1 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

.layout-main {
    grid-template-columns: 1fr 1fr;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flex-fill {
    flex: 1;
}

.mt-3 {
    margin-top: 1rem;
}

/* Panels and Glassmorphism */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel {
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header h2 {
    margin-bottom: 0;
}

header {
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Forms */
.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 184, 148, 0.2);
}

.textarea {
    min-height: 120px;
    resize: vertical;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Color Pickers Area */
.color-picker-wrapper {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    width: 120px;
    height: 120px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: var(--radius-md);
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.color-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Previews */
.preview-area {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.swatch-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.contrast-overlay {
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.8;
}

.preview-details {
    flex: 1;
}

.color-name.title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.color-semantic-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 1.25rem;
}

/* Actions */
.actions,
.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.25rem;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.btn-icon {
    padding: 0.4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFF;
}

/* Variations Grid */
.variations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.variation-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.variation-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--surface-border);
    transform: translateY(-2px);
}

.var-swatch {
    height: 40px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.var-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.var-hex {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.hist-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.hist-details {
    flex: 1;
    overflow: hidden;
}

.hist-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hist-hex {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1.5rem;
    font-style: italic;
}

/* Bulk Section */
.bulk-container {
    display: flex;
    gap: 1.5rem;
}

.bulk-input {
    flex: 1;
}

.bulk-results {
    flex: 2;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.bulk-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.bulk-token {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent);
    flex: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: var(--transition);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* Responsive */
@media (max-width: 900px) {
    .layout-main {
        grid-template-columns: 1fr;
    }

    .bulk-container {
        flex-direction: column;
    }

    .history-list {
        max-height: 200px;
    }
}

@media (max-width: 600px) {
    .color-picker-wrapper {
        flex-direction: column;
    }

    input[type="color"] {
        width: 100%;
        height: 80px;
    }

    .preview-area {
        flex-direction: column;
        text-align: center;
    }
}