:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #f43f5e;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Animation */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(244, 63, 94, 0.1) 0%, transparent 50%);
    filter: blur(80px);
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: var(--text-main);
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Palette Generator Styles */
/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.palette-main {
    flex: 1;
    min-width: 0;
}

.palette-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.control-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.palette-container {
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 600px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    background: transparent;
}

.color-card {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    margin: 0;
    padding: 0;
}

.color-card:last-child {
    border-right: none;
}

.color-card:hover {
    transform: translateY(-5px);
}

.color-preview {
    width: 100%;
    height: 100%;
    position: relative;
    transition: background-color 0.4s ease;
}

.color-info {
    padding: 2rem 0.5rem;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    pointer-events: none; /* Allow clicks to pass to card if needed */
}

.color-info * {
    pointer-events: auto; /* Buttons still clickable */
}

.color-hex {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
}

.color-actions {
    display: flex;
    gap: 0.4rem;
    flex-direction: row;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.color-card:hover .color-actions {
    opacity: 1;
    transform: translateY(0);
}

.color-card:hover .color-hex {
    transform: translateY(-5px);
}

.color-actions .icon-btn {
    padding: 0.45rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
}

@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column-reverse;
    }
    .palette-sidebar {
        width: 100%;
        position: static;
    }
    .palette-container {
        height: 400px;
    }
    .color-hex {
        writing-mode: horizontal-tb;
        transform: none;
    }
    .color-actions {
        flex-direction: row;
    }
}

/* Controls */
.icon-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.icon-btn.locked {
    color: var(--accent);
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Extractor Section */
.extractor-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.url-input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    outline: none;
}

.url-input:focus {
    border-color: var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Color Wheel Handles */
.wheel-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    cursor: grab;
    transition: transform 0.1s;
    z-index: 10;
}

.wheel-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.wheel-handle.main {
    width: 26px;
    height: 26px;
    border-width: 4px;
    z-index: 20;
}

footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

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