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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.language-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: white;
    color: #667eea;
}

main {
    padding: 40px;
}

.color-picker-section {
    text-align: center;
    margin-bottom: 40px;
}

.color-display {
    display: inline-block;
    position: relative;
}

.color-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #3498db;
    box-shadow: 0 10px 40px rgba(52, 152, 219, 0.4);
    cursor: pointer;
    transition: transform 0.3s;
}

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

#colorPicker {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.converter-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
}

.converter-arrow {
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
}

.rgb-inputs h3,
.hex-inputs h3,
.hsl-display h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
}

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

.slider-group label {
    width: 30px;
    font-weight: 600;
    color: #555;
}

.slider-group input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.slider-group input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.rgb-text-input,
.hex-input-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.rgb-text-input input,
.hex-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: monospace;
}

.copy-btn {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #5a67d8;
}

.hsl-display {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.hsl-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#hslDisplay {
    font-size: 1.2em;
    font-family: monospace;
    color: #2c3e50;
}

.palette-section {
    margin-bottom: 40px;
}

.palette-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.palette-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.palette-tab {
    padding: 10px 20px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.palette-tab:hover {
    background: #e0e0e0;
}

.palette-tab.active {
    background: #667eea;
    color: white;
}

.palette-colors {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.palette-color {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.color-code {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-family: monospace;
    position: absolute;
    bottom: 10px;
}

.saved-colors-section {
    margin-bottom: 40px;
}

.saved-colors-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.saved-colors {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    min-height: 60px;
}

.saved-color {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.delete-color {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.saved-color:hover .delete-color {
    display: flex;
}

.save-color-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.save-color-btn:hover {
    background: #5a67d8;
}

.usage-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
}

.usage-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.usage-section ol {
    padding-left: 20px;
}

.usage-section li {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .input-group {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .converter-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .color-preview {
        width: 150px;
        height: 150px;
    }
    
    .palette-color {
        width: 80px;
        height: 80px;
    }
    
    main {
        padding: 20px;
    }
    
    header {
        padding: 30px 20px;
    }
}