/* Color Finder Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #00a68b 0%, #024854 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Bar */
.top-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo-link {
    display: block;
}

.logo {
    height: 40px;
    width: auto;
}

.links-panel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.info-link {
    color: #00a68b;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.info-link:hover, .info-link.active {
    background: #00a68b;
    color: white;
}

.controls-panel {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    width: 100px;
}

.color-picker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #00a68b;
    color: white;
}

.btn-primary:hover {
    background: #008a75;
}

.btn-secondary {
    background: #024854;
    color: white;
}

.btn-secondary:hover {
    background: #013a44;
}

.control-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.slider {
    width: 80px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-btn {
    padding: 8px 16px;
    border: 2px solid #00a68b;
    background: transparent;
    color: #00a68b;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}

.view-btn.active {
    background: #00a68b;
    color: white;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

/* Generated Colors */
.generated-colors-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toggle-btn {
    padding: 8px 16px;
    background: #764ba2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.generated-colors-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.color-system-section {
    margin-bottom: 30px;
}

.color-example {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.color-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #ddd;
}

/* Color Cards */
.color-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.color-preview {
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hex-value {
    font-family: monospace;
    font-weight: bold;
    font-size: 14px;
}

.input-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.color-info {
    padding: 10px;
}

.lab-values {
    font-family: monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.distance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delta-e {
    font-weight: bold;
    color: #667eea;
}

.description {
    font-size: 12px;
    color: #999;
}

.color-card.compact {
    height: 60px;
}

.color-card.compact .color-preview {
    height: 100%;
}

/* Generated Colors */
.generated-color-box {
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.generated-color-box:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-panel {
        justify-content: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
