/* Color Hex Info Styles */
.chi-wrapper {
    max-width: 1000px;
    background: #fff;
    border: 1px solid #e6e6e6;
    padding: 20px;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chi-wrapper.dark {
    background: #2d2d2d;
    color: #f0f0f0;
    border-color: #444;
}

.chi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.chi-wrapper.dark .chi-header {
    border-bottom-color: #444;
}

.chi-theme-toggle {
    display: flex;
    gap: 5px;
}

.chi-theme-btn {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.chi-wrapper.dark .chi-theme-btn {
    background: #444;
    border-color: #555;
    color: #f0f0f0;
}

.chi-theme-btn.active {
    background: #2d8be6;
    color: white;
    border-color: #2d8be6;
}

.chi-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.chi-inputs, .chi-preview {
    flex: 1;
    min-width: 300px;
}

.chi-input-group {
    margin-bottom: 20px;
}

.chi-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.chi-input-row {
    display: flex;
    gap: 10px;
}

.chi-hex-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
}

.chi-wrapper.dark .chi-hex-input {
    background: #444;
    border-color: #555;
    color: #f0f0f0;
}

.chi-color-input {
    width: 50px;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.chi-btn {
    padding: 10px 15px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    background: #2d8be6;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
}

.chi-btn:hover {
    background: #1e6bb8;
}

.chi-btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.chi-img-input {
    display: block;
    margin-bottom: 10px;
}

.chi-canvas-container {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.chi-wrapper.dark .chi-canvas-container {
    border-color: #555;
}

.chi-img-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

.chi-canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.chi-canvas-container:hover .chi-canvas-overlay {
    opacity: 1;
}

.chi-code-container {
    position: relative;
}

.chi-code {
    width: 100%;
    padding: 15px;
    border-radius: 6px;
    background: #f6f6f6;
    border: 1px solid #eee;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    min-height: 80px;
    margin-bottom: 10px;
}

.chi-wrapper.dark .chi-code {
    background: #333;
    border-color: #444;
    color: #f0f0f0;
}

.chi-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.chi-formats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chi-format-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.chi-wrapper.dark .chi-format-item {
    background: #333;
    border-color: #444;
}

.chi-format-label {
    font-weight: 600;
    width: 50px;
}

.chi-format-value {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
}

.chi-preview-group {
    margin-bottom: 20px;
}

.chi-preview-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chi-sample-box {
    height: 120px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chi-sample-text {
    font-weight: 600;
    font-size: 18px;
}

.chi-color-details {
    text-align: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.chi-wrapper.dark .chi-color-details {
    background: #333;
}

.chi-color-name {
    font-weight: 600;
    font-size: 16px;
}

.chi-color-hex {
    font-family: monospace;
    font-size: 14px;
    color: #666;
}

.chi-wrapper.dark .chi-color-hex {
    color: #aaa;
}

.chi-samples {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chi-sample-btn {
    padding: 10px 15px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    font-weight: 500;
}

.chi-sample-link {
    color: inherit;
    text-decoration: underline;
}

.chi-sample-card {
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

.chi-wrapper.dark .chi-sample-card {
    border-color: #444;
}

.chi-sample-card-header {
    padding: 10px;
    font-weight: 600;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.chi-wrapper.dark .chi-sample-card-header {
    background: #333;
    border-bottom-color: #444;
}

.chi-sample-card-body {
    padding: 10px;
}

.chi-advanced-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chi-advanced-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chi-advanced-option input[type="range"] {
    width: 100%;
}

.chi-palettes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chi-palette-group h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.chi-palette {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chi-palette-item {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.chi-palette-item:hover {
    transform: scale(1.1);
}

.chi-palette-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.chi-palette-item:hover .chi-palette-tooltip {
    opacity: 1;
}

.chi-history {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.chi-wrapper.dark .chi-history {
    border-top-color: #444;
}

.chi-history h4 {
    margin-bottom: 10px;
}

.chi-history-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.chi-history-item {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.chi-history-item:hover {
    border-color: #2d8be6;
}

/* Responsive styles */
@media (max-width: 768px) {
    .chi-row {
        flex-direction: column;
    }
    
    .chi-palettes {
        grid-template-columns: 1fr;
    }
}