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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.logo-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: color 0.3s;
}

.nav a:hover {
    color: #333;
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Control Panel */
.control-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    height: fit-content;
}

.color-display {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.hex-value {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.rgb-controls {
    margin-bottom: 20px;
}

.rgb-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rgb-label {
    width: 15px;
    font-weight: 600;
    color: #666;
}

.rgb-value {
    width: 40px;
    font-size: 14px;
    color: #888;
}

.slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    outline: none;
    background: linear-gradient(to right, #ddd, #666);
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}

/* Algorithm Section */
.algorithm-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.select-dropdown {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    margin-bottom: 20px;
}

.contrast-control {
    margin-bottom: 20px;
}

.contrast-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.contrast-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ddd, #333);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.contrast-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Naming Section */
.naming-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.shade-count-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.count-button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.count-button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.count-display {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    min-width: 60px;
    text-align: center;
}

/* Palette Container */
.palette-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.palette-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.05);
}

.swatch-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    font-size: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.color-swatch:hover .swatch-info {
    opacity: 1;
}

/* Enhancement Section */
.enhancement-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.enhancement-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.enhancement-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.enhancement-feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.enhancement-feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.enhancement-feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.enhancement-feature-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.enhancement-feature-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.quick-action.secondary {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.quick-action.secondary:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

/* Brands Section */
.brands-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.brands-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.brand-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.brand-logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-colors {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.brand-color {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.brand-name {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

/* Brand Modal */
.brand-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.brand-modal.active {
    opacity: 1;
    visibility: visible;
}

.brand-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

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

.brand-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.brand-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.brand-modal-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.brand-modal-color {
    text-align: center;
}

.brand-modal-color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.brand-modal-color-circle:hover {
    transform: scale(1.1);
}

.brand-modal-color-code {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    font-family: monospace;
}

.brand-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.brand-modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.brand-modal-btn.primary {
    background: #667eea;
    color: white;
}

.brand-modal-btn.primary:hover {
    background: #5a6fd8;
}

.brand-modal-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.brand-modal-btn.secondary:hover {
    background: #e9ecef;
}

/* History Section */
.history-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.history-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.history-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.history-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.history-preview {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 8px;
}

.history-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.history-name {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.history-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover .history-delete {
    opacity: 1;
}

/* Accessibility Info */
.accessibility-info {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 0;
    border-left: 4px solid #10b981;
}

.accessibility-score {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.score-badge {
    background: #10b981;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.score-text {
    font-size: 14px;
    color: #666;
}

.harmony-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    margin-bottom: 0;
}

.harmony-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.harmony-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Code Section */
.code-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.code-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 6px;
}

.code-tab {
    padding: 12px 20px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    flex: 1;
    text-align: center;
    position: relative;
}

.code-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.code-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.format-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 6px;
    border: 1px solid #e9ecef;
}

.format-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.format-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.format-tab.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.code-output {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    position: relative;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.copy-button:hover {
    background: #5a6fd8;
}

.copy-button.copied {
    background: #10b981;
}

/* Footer */
.footer {
    background: #000000;
    color: white;
    padding: 40px 0 20px;
    margin-top: 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: white;
}

.footer-section p {
    color: white;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #FF6B35;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #FF8C42;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #333333;
    margin-top: 30px;
}

.footer-bottom p {
    color: white;
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        gap: 25px;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .enhancement-features {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 15px;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .enhancement-section {
        padding: 25px 20px;
    }
    
    .enhancement-title {
        font-size: 20px;
    }
    
    .enhancement-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .quick-action {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .brand-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .brand-modal-colors {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
    
    .code-tabs {
        gap: 3px;
        padding: 4px;
    }
    
    .code-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .format-tabs {
        gap: 3px;
        padding: 4px;
    }
    
    .format-tab {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 8px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .control-panel, .algorithm-section, .naming-section {
        padding: 20px;
    }
    
    .color-display {
        width: 60px;
        height: 60px;
    }
    
    .hex-value {
        font-size: 16px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 6px;
    }
    
    .color-swatch {
        border-radius: 6px;
    }
    
    .swatch-info {
        font-size: 9px;
        padding: 3px;
    }
    
    .enhancement-section {
        padding: 20px 15px;
    }
    
    .enhancement-title {
        font-size: 18px;
    }
    
    .enhancement-feature {
        padding: 15px;
    }
    
    .enhancement-feature-icon {
        font-size: 28px;
    }
    
    .enhancement-feature-title {
        font-size: 14px;
    }
    
    .enhancement-feature-desc {
        font-size: 12px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .brand-card {
        padding: 15px;
    }
    
    .brand-logo {
        font-size: 16px;
        height: 25px;
    }
    
    .brand-color {
        width: 20px;
        height: 20px;
    }
    
    .brand-name {
        font-size: 12px;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
    
    .history-item {
        padding: 12px;
    }
    
    .history-color {
        width: 16px;
        height: 16px;
    }
    
    .history-name {
        font-size: 11px;
    }
    
    .code-tabs {
        gap: 2px;
        padding: 3px;
    }
    
    .code-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .format-tabs {
        gap: 2px;
        padding: 3px;
    }
    
    .format-tab {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .code-output {
        font-size: 11px;
        padding: 15px;
    }
    
    .copy-button {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .brand-modal-content {
        padding: 15px;
    }
    
    .brand-modal-title {
        font-size: 18px;
    }
    
    .brand-modal-colors {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .brand-modal-color-circle {
        width: 50px;
        height: 50px;
    }
    
    .brand-modal-color-code {
        font-size: 10px;
    }
    
    .toast {
        right: 10px;
        top: 10px;
        font-size: 12px;
        padding: 10px 15px;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 5px;
    }
    
    .palette-grid {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 4px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .brand-card {
        padding: 10px;
    }
    
    .enhancement-features {
        gap: 10px;
    }
    
    .enhancement-feature {
        padding: 12px;
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
}