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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.upload-zone {
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-zone:hover {
    border-color: #764ba2;
    background: #f0f1ff;
    transform: translateY(-5px);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-zone p {
    font-size: 1.2em;
    color: #666;
    margin: 10px 0;
}

.upload-hint {
    font-size: 0.9em !important;
    color: #999 !important;
}

.canvas-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.image-canvas {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    cursor: crosshair;
    display: block;
}

.magnifier {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.hover-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    pointer-events: none;
    white-space: nowrap;
}

.color-info-panel {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.color-swatch-large {
    width: 100%;
    height: 150px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.color-name {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.color-formats {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.color-format {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.format-label {
    font-weight: bold;
    color: #667eea;
    min-width: 120px;
}

.format-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    color: #333;
    margin: 0 15px;
}

.copy-btn {
    background: #667eea;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.copy-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.complementary-color {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: bold;
    color: #333;
}

.color-swatch-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.control-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.control-item input[type="range"] {
    width: 150px;
    cursor: pointer;
}

.btn, .btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover, .btn-small:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9em;
}

.color-history {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

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

.history-header h3 {
    color: #333;
    font-size: 1.5em;
}

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

.history-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.history-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.footer p {
    color: #666;
    margin: 10px 0;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #764ba2;
}

.fun-fact {
    font-style: italic;
    font-size: 0.9em;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .control-item {
        width: 100%;
    }
    
    .history-swatches {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}