/* ============================================
   ColorConverter.css - 顏色轉換器專用樣式
   ============================================

   ⚠️ IMPORTANT: Only calculator-specific styles here!
   DO NOT redefine global classes (.glass-card, .form-input, .btn-*, etc.)

   Global classes are defined in Content/layout.css
   See GLOBAL_CSS_CLASSES.md for complete reference
   ============================================ */

/* ============================================
   COLOR PICKER & DISPLAY
   ============================================ */

/* Color picker input container */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Large color preview box */
.color-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.color-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Native color picker (hidden but functional) */
.color-input-native {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============================================
   CONVERSION RESULTS
   ============================================ */

/* Result value display */
.result-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.result-value:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Copy button inside result */
.result-value .btn-copy {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-value .btn-copy:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Result label */
.result-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-label i {
    color: #667eea;
}

/* ============================================
   COLOR PALETTE DISPLAY
   ============================================ */

/* Palette type selector */
.palette-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.palette-btn {
    padding: 10px 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.palette-btn i {
    font-size: 1.2rem;
    color: #667eea;
}

.palette-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
}

.palette-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.palette-btn.active i {
    color: white;
}

/* Palette color swatches */
.palette-colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.palette-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.palette-swatch-color {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.palette-swatch-color:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.palette-swatch-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.palette-swatch-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
}

/* ============================================
   CONTRAST CHECKER
   ============================================ */

/* Contrast preview box */
.contrast-preview {
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.contrast-preview-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.contrast-preview-small {
    font-size: 1rem;
    margin-top: 10px;
}

/* Contrast ratio result */
.contrast-ratio-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #2d3748;
    text-align: center;
    margin: 20px 0;
}

.contrast-ratio-display span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* WCAG compliance badges */
.wcag-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.wcag-badge {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid;
    transition: all 0.3s ease;
}

.wcag-badge.pass {
    background: #f0fdf4;
    border-color: #48bb78;
    color: #22543d;
}

.wcag-badge.fail {
    background: #fef2f2;
    border-color: #f56565;
    color: #742a2a;
}

.wcag-badge-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.wcag-badge-status {
    font-size: 1.2rem;
    font-weight: 700;
}

.wcag-badge-status i {
    margin-right: 5px;
}

/* ============================================
   SLIDERS & CONTROLS
   ============================================ */

/* Custom range slider container */
.slider-container {
    margin-bottom: 20px;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
}

.slider-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #667eea;
    background: #f7fafc;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Custom styled range input */
.range-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   FORMAT TABS
   ============================================ */

/* Tab navigation */
.format-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.format-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s ease;
}

.format-tab:hover {
    color: #667eea;
}

.format-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Tab content */
.format-tab-content {
    display: none;
}

.format-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============================================
   MANUAL INPUT GROUPS (RGB & HSL)
   ============================================ */

/* RGB input group */
.rgb-input-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.rgb-input-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rgb-input-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.rgb-input {
    text-align: center;
    padding: 8px;
    font-family: 'Roboto Mono', monospace;
}

/* HSL input group */
.hsl-input-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.hsl-input-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.hsl-input-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.hsl-input {
    text-align: center;
    padding: 8px 24px 8px 8px;
    font-family: 'Roboto Mono', monospace;
}

.input-unit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: #718096;
    pointer-events: none;
}

/* LAB input group */
.lab-input-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.lab-input-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lab-input-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
}

.lab-input {
    text-align: center;
    padding: 8px;
    font-family: 'Roboto Mono', monospace;
}

/* ============================================
   COLOR HISTORY
   ============================================ */

/* Recently used colors */
.color-history {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.color-history-item {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-history-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Success animation for copy */
.copied {
    animation: pulse 0.3s ease;
    border-color: #48bb78 !important;
    background: #f0fdf4 !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .color-picker-container {
        flex-direction: column;
        align-items: stretch;
    }

    .color-preview {
        width: 100%;
        height: 60px;
    }

    .rgb-input-group,
    .hsl-input-group,
    .lab-input-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .rgb-input,
    .hsl-input,
    .lab-input {
        font-size: 0.9rem;
        padding: 6px;
    }

    .result-value {
        font-size: 1rem;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .result-value .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .palette-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .palette-colors {
        grid-template-columns: repeat(2, 1fr);
    }

    .wcag-badges {
        grid-template-columns: 1fr;
    }

    .contrast-ratio-display {
        font-size: 2rem;
    }

    .contrast-preview-text {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .palette-selector {
        grid-template-columns: 1fr;
    }

    .format-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .format-tab {
        text-align: center;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .format-tab.active {
        border-left-color: #667eea;
        background: #f7fafc;
    }
}
