/**
 * Color Converter Styles
 * Color Converter Tool Styles
 *
 * @package Zipper
 */

/* Color Preview Area */
.color-preview-section {
    margin-bottom: 24px;
}

.color-preview-container {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.color-preview-box {
    flex: 1;
    min-height: 180px;
    border-radius: 16px;
    border: 1px solid #e8e4dc;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s;
}

.color-preview-box:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.color-preview-inner {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-preview-text {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #2d2a26;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 16px;
}

.color-picker-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.color-picker-input {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: 2px solid #e8e4dc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker-input::-moz-color-swatch {
    border: 2px solid #e8e4dc;
    border-radius: 12px;
}

/* Color Input Groups */
.color-inputs-section {
    margin-bottom: 24px;
}

.color-inputs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.color-input-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.color-input-card:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.color-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.color-input-label {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-input-label i {
    color: #d4af37;
}

.color-input-copy {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 12px;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.color-input-copy:hover {
    background: #fff;
    border-color: #d4af37;
    color: #d4af37;
}

.color-input-copy i {
    font-size: 12px;
}

/* HEX Input */
.hex-input-wrapper {
    position: relative;
}

.hex-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 600;
    color: #8c8579;
    font-family: 'Consolas', 'Monaco', monospace;
}

.hex-input {
    width: 100%;
    padding: 12px 12px 12px 28px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    background: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.2s;
}

.hex-input:focus {
    outline: none;
    border-color: #d4af37;
}

/* RGB/HSL Inputs */
.rgb-inputs,
.hsl-inputs {
    display: flex;
    gap: 8px;
}

.rgb-input-group,
.hsl-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rgb-input-group label,
.hsl-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #8c8579;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rgb-input,
.hsl-input {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    background: #fff;
    text-align: center;
    transition: border-color 0.2s;
}

.rgb-input:focus,
.hsl-input:focus {
    outline: none;
    border-color: #d4af37;
}

/* CSS Code Section */
.css-code-section {
    margin-bottom: 24px;
}

.css-code-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    overflow: hidden;
}

.css-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e4dc;
    background: #fff;
}

.css-code-tabs {
    display: flex;
    gap: 4px;
}

.css-code-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.css-code-tab:hover {
    background: #faf9f7;
}

.css-code-tab.active {
    background: #d4af37;
    color: #fff;
}

.css-code-actions {
    display: flex;
    gap: 8px;
}

.css-code-copy {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 13px;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.css-code-copy:hover {
    background: #fff;
    border-color: #d4af37;
    color: #d4af37;
}

.css-code-body {
    padding: 16px;
}

.css-code-display {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    color: #2d2a26;
    background: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #e8e4dc;
    word-break: break-all;
}

.css-code-display .property {
    color: #0550ae;
}

.css-code-display .value {
    color: #d4af37;
    font-weight: 600;
}

/* History Section */
.color-history-section {
    margin-bottom: 24px;
}

.color-history-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

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

.color-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-history-title i {
    color: #d4af37;
}

.color-history-clear {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    font-size: 12px;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.color-history-clear:hover {
    background: #fff;
    border-color: #dc3232;
    color: #dc3232;
}

.color-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-history-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e8e4dc;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-history-item:hover {
    transform: scale(1.1);
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-history-item::after {
    content: attr(data-hex);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #2d2a26;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    font-family: 'Consolas', 'Monaco', monospace;
}

.color-history-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.color-history-empty {
    width: 100%;
    padding: 20px;
    text-align: center;
    color: #8c8579;
    font-size: 13px;
}

/* Utility Buttons */
.color-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.color-action-btn {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-action-btn:hover {
    background: #faf9f7;
    border-color: #d4af37;
    color: #d4af37;
}

.color-action-btn i {
    font-size: 16px;
}

.color-action-btn.primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: #d4af37;
    color: #fff;
}

.color-action-btn.primary:hover {
    background: linear-gradient(135deg, #e5c04a 0%, #c99a1c 100%);
}

/* Responsive */
@media (max-width: 992px) {
    .color-inputs-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .color-preview-container {
        flex-direction: column;
        gap: 16px;
    }

    .color-preview-box {
        min-height: 140px;
    }

    .color-preview-inner {
        min-height: 140px;
    }

    .color-picker-wrapper {
        flex-direction: row;
        justify-content: center;
        padding: 12px 16px;
    }

    .color-picker-input {
        width: 60px;
        height: 60px;
    }

    .css-code-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .css-code-tabs {
        justify-content: center;
    }

    .css-code-actions {
        justify-content: center;
    }

    .color-actions {
        flex-wrap: wrap;
    }

    .color-action-btn {
        flex: 1;
        min-width: calc(50% - 6px);
        justify-content: center;
    }

    .rgb-inputs,
    .hsl-inputs {
        gap: 6px;
    }

    .rgb-input,
    .hsl-input {
        padding: 8px 4px;
        font-size: 13px;
    }

    .color-history-item {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .hex-input {
        font-size: 14px;
        padding: 10px 10px 10px 24px;
    }

    .hex-prefix {
        font-size: 14px;
        left: 10px;
    }

    .css-code-tab {
        padding: 6px 10px;
        font-size: 12px;
    }

    .css-code-display {
        font-size: 13px;
        padding: 12px;
    }

    .color-action-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
