* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: rgb(26, 26, 26);
    color: #e0e0e0;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.header p {
    color: #888;
    font-size: 0.95rem;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.mode-btn {
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    color: #e0e0e0;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-btn:hover {
    background: #333;
    border-color: #555;
}

.mode-btn.active {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border-color: #2196F3;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.picker-section {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.color-display {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

.color-picker-canvas {
    width: 100%;
    height: calc(100% - 40px);
    cursor: crosshair;
}

.hue-slider-container {
    height: 40px;
    padding: 10px;
    background: #222;
}

.hue-slider {
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(to right, 
        #ff0000 0%, #ffff00 17%, #00ff00 33%, 
        #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    position: relative;
    cursor: pointer;
}

.hue-slider-thumb {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #000;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hue-slider-thumb:active {
    cursor: grabbing;
}

.picker-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px black, 0 2px 8px rgba(0,0,0,0.3);
}

.color-input-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.color-input-group {
    flex: 1;
    min-width: 200px;
}

.color-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.color-input {
    width: 100%;
    height: 60px;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-input:hover {
    border-color: #555;
}

.format-outputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.format-output {
    background: #222;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.format-output label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.format-output input {
    width: calc(100% - 55px);
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    outline: none; 
}

.copy-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #3a3a3a;
    border: none;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.copy-btn:hover {
    background: #2196F3;
}

.copy-btn.copied {
    background: #4caf50;
}

.harmony-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.harmony-btn {
    background: #222;
    border: 2px solid #3a3a3a;
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.harmony-btn:hover {
    border-color: #555;
}

.harmony-btn.active {
    background: #2196F3;
    border-color: #2196F3;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.color-card {
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.color-card:hover {
    transform: translateY(-5px);
}

.color-card-preview {
    width: 100%;
    height: 150px;
}

.color-card-info {
    padding: 15px;
}

.color-card-info p {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.image-upload-zone {
    border: 2px dashed #3a3a3a;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.image-upload-zone:hover {
    border-color: #2196F3;
    background: #222;
}

.image-upload-zone.dragover {
    border-color: #2196F3;
    background: #1a2a3a;
}

.canvas-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
}

#imageCanvas {
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    border-radius: 12px;
    cursor: crosshair;
}

.picked-color-info {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    width: 400px;
    max-width: 100%;
}

.photo-picker-grid {
display: flex;
flex-wrap: wrap;          
justify-content: center;  
gap: 10px;
}



.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.action-btn {
    background: #3a3a3a;
    border: none;
    color: #e0e0e0;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: #2196F3;
}

.slider-group {
    margin-bottom: 20px !important;
}

.slider-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
    font-size: 0.9rem;
}

.slider {
    width: 100% !important;
    height: 6px !important;
    border-radius: 3px !important;
    background: #3a3a3a !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #2196F3 !important;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: #2196F3 !important;
    cursor: pointer;
    border: none;
}

.contrast-checker {
    background: #222 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-top: 20px !important;
}

.contrast-preview {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.contrast-sample {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.contrast-ratio {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
}

.contrast-rating {
    font-size: 0.9rem;
    color: #aaa;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .picker-section {
        padding: 20px;
    }

    .color-display {
        height: 150px;
    }

    .palette-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .color-card-preview {
        height: 100px;
    }

    .format-outputs {
        grid-template-columns: 1fr;
    }
}

.zoom-indicator {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.export-palette-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    z-index: 1000;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.export-palette-modal.show {
    display: block;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
}

.modal-overlay.show {
    display: block;
}

.export-option {
    background: #222;
    border: 2px solid #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-option:hover {
    border-color: #2196F3;
}

.gradient-preview {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 0.95rem;
}