:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --accent-color: #8B5CF6;
    --text-color: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;    
    --radius-2xl: 1.5rem;
    
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    
    --danger-color: #EF4444;
    --danger-light: #FCA5A5;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    
    --brand-primary: var(--primary-color);
    --brand-secondary: var(--secondary-color);
    --text-primary: var(--text-color);
}

[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

body {
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* Hero Section */
.tool-hero {
    margin-top: 0;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
}

.tool-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    animation: heroBackgroundPulse 8s ease-in-out infinite;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    box-shadow: 
        0 15px 35px rgba(59, 130, 246, 0.4),
        0 0 0 10px rgba(59, 130, 246, 0.1),
        0 0 0 20px rgba(59, 130, 246, 0.05);
    position: relative;
    overflow: hidden;
}

.hero-icon i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 20px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 50%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heroTitleShine 4s ease-in-out infinite;
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: heroDescriptionFade 3s ease-in-out infinite;
}

/* Control Bar */
.control-bar {
    padding: 2rem 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.calculator-card {
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto;
}

.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.primary-controls {
    flex: 1;
}

.spacebar-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

.spacebar-hint i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.action-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.control-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.control-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.control-btn.primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.control-btn.generate-btn {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.control-btn.generate-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Palette Display */
.palette-display {
    flex: 1;
    min-height: calc(100vh - 400px);
}

.palette-container {
    display: flex;
    height: 100%;
    min-height: calc(100vh - 400px);
}

.color-column {
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.color-column:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
}

.color-column:hover .color-overlay {
    opacity: 1;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    padding: 2rem;
}

.color-controls button {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    color: #1f2937 !important;
    text-shadow: none;
    font-size: 0.85rem;
}

.color-controls button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    color: #111827 !important;
}

.hex-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1f2937 !important;
    font-weight: 700 !important;
}

.hex-code:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: #111827 !important;
}

.lock-btn.locked {
    background: var(--warning-color) !important;
    color: white !important;
    border-color: var(--warning-color) !important;
}

.lock-btn.locked:hover {
    background: var(--danger-color) !important;
    color: white !important;
    border-color: var(--danger-color) !important;
}

.adjust-btn:hover {
    background: var(--accent-color) !important;
    color: white !important;
    border-color: var(--accent-color) !important;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-base);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Color Adjustment Modal */
.color-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
}

.slider-group {
    margin-bottom: 1.5rem;
}

.slider-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.slider-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.slider-value {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Export Modal */
.export-option {
    margin-bottom: 2rem;
}

.export-option h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.export-input-group {
    display: flex;
    gap: 0.5rem;
}

.export-input-group input,
.export-input-group textarea {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    resize: none;
}

.export-input-group textarea {
    min-height: 80px;
}

.copy-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(100%) translateX(20px);
    transition: all 0.3s ease;
    z-index: 1100;
    font-weight: 500;
}

.copy-notification.show {
    transform: translateX(0);
}

/* Drag and Drop */
.color-column.dragging {
    opacity: 0.5;
}

.color-column.drag-over {
    border-left: 4px solid var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .controls-wrapper {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .action-controls {
        justify-content: center;
    }
    
    .palette-container {
        flex-direction: column;
        min-height: calc(100vh - 300px);
    }
    
    .color-column {
        min-height: 120px;
    }
    
    .color-column:hover {
        transform: none;
    }
    
    .color-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .color-controls button {
        min-width: auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        width: 80px;
        height: 80px;
    }
    
    .hero-icon i {
        font-size: 2.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .spacebar-hint {
        font-size: 1rem;
    }
    
    .control-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes heroBackgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes heroTitleShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes heroDescriptionFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}
