/**
 * Contrast Checker Styles (English)
 * Color Contrast Checker Tool Styles
 *
 * @package Zipper
 */

/* ========================================
   Preview Section
======================================== */
.contrast-preview-section {
    margin-bottom: 1.5rem;
}

.contrast-preview-container {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.contrast-preview-box {
    flex: 1;
    min-height: 200px;
    border-radius: 16px;
    border: 1px solid #e8e4dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    transition: box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.preview-sample-text {
    text-align: center;
}

.preview-sample-text .large-text {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.preview-sample-text .normal-text {
    font-size: 16px;
    line-height: 1.6;
}

.preview-label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #5f5a56;
    backdrop-filter: blur(4px);
}

/* ========================================
   Contrast Result Section
======================================== */
.contrast-result-section {
    margin-bottom: 1.5rem;
}

.contrast-result-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

.contrast-ratio-display {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e4dc;
}

.contrast-ratio-value {
    font-size: 48px;
    font-weight: 800;
    color: #2d2a26;
    font-family: 'Consolas', 'Monaco', monospace;
}

.contrast-ratio-label {
    font-size: 14px;
    color: #5f5a56;
    margin-top: 4px;
}

.wcag-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.wcag-result-item {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    transition: border-color 0.2s;
}

.wcag-result-item.pass {
    border-color: #28a745;
}

.wcag-result-item.fail {
    border-color: #dc3545;
}

.wcag-level {
    font-size: 13px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 4px;
}

.wcag-type {
    font-size: 11px;
    color: #5f5a56;
    margin-bottom: 8px;
}

.wcag-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.wcag-status.pass {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.wcag-status.fail {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.wcag-ratio {
    font-size: 11px;
    color: #8c8579;
    margin-top: 6px;
}

/* ========================================
   Color Input Section
======================================== */
.contrast-input-section {
    margin-bottom: 1.5rem;
}

.color-input-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.color-input-card {
    flex: 1;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

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

.color-input-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.color-picker-btn {
    padding: 6px 12px;
    background: #fff;
    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-picker-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.color-input-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-picker-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-picker-input {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 10px;
    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: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.hex-input-wrapper {
    flex: 1;
    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: 14px 14px 14px 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-inputs {
    display: flex;
    gap: 8px;
}

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

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

.rgb-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 {
    outline: none;
    border-color: #d4af37;
}

/* Swap Button */
.swap-btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f5a56;
}

.swap-btn:hover {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
    transform: rotate(180deg);
}

.swap-btn i {
    font-size: 18px;
}

/* ========================================
   Action Button Section
======================================== */
.contrast-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.contrast-action-btn {
    padding: 12px 24px;
    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: 8px;
}

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

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

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

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

.contrast-action-btn.random {
    background: #fff;
    border-color: #e8e4dc;
    color: #5f5a56;
}

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

/* ========================================
   Color Blindness Simulation Section
======================================== */
.colorblind-section {
    margin-bottom: 1.5rem;
}

.colorblind-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

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

.colorblind-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.colorblind-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.colorblind-toggle label {
    font-size: 13px;
    color: #5f5a56;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e8e4dc;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #d4af37;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.colorblind-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.colorblind-item {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.colorblind-preview {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.colorblind-name {
    font-size: 12px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 2px;
}

.colorblind-desc {
    font-size: 10px;
    color: #8c8579;
}

.colorblind-ratio {
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
    margin-top: 6px;
    padding: 4px 8px;
    background: #faf9f7;
    border-radius: 4px;
    display: inline-block;
}

/* ========================================
   Suggestion Section
======================================== */
.suggestion-section {
    margin-bottom: 1.5rem;
}

.suggestion-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

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

.suggestion-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.suggestion-item {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-item:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.suggestion-preview {
    height: 50px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.suggestion-info {
    text-align: center;
}

.suggestion-hex {
    font-size: 12px;
    font-weight: 600;
    color: #2d2a26;
    font-family: 'Consolas', 'Monaco', monospace;
}

.suggestion-ratio {
    font-size: 11px;
    color: #28a745;
    margin-top: 2px;
}

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

/* ========================================
   History Section
======================================== */
.history-section {
    margin-bottom: 1.5rem;
}

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

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

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

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

.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;
}

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

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

.history-item {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e8e4dc;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: #d4af37;
    transform: scale(1.02);
}

.history-color {
    width: 32px;
    height: 32px;
}

.history-ratio {
    padding: 0 8px;
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #2d2a26;
    background: #fff;
    font-family: 'Consolas', 'Monaco', monospace;
}

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

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 992px) {
    .wcag-results {
        grid-template-columns: repeat(4, 1fr);
    }

    .colorblind-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .contrast-preview-box {
        min-height: 160px;
    }

    .color-input-row {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .swap-btn-wrapper {
        order: -1;
        margin-bottom: 8px;
    }

    .swap-btn {
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }

    .contrast-ratio-value {
        font-size: 40px;
    }

    .wcag-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .wcag-result-item {
        padding: 12px 8px;
    }

    .colorblind-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .suggestion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .contrast-preview-box {
        min-height: 140px;
        padding: 16px;
    }

    .preview-sample-text .large-text {
        font-size: 20px;
    }

    .preview-sample-text .normal-text {
        font-size: 14px;
    }

    .color-picker-row {
        flex-direction: column;
        align-items: stretch;
    }

    .color-picker-input {
        width: 100%;
        height: 50px;
    }

    .hex-input-wrapper {
        width: 100%;
    }

    .hex-input {
        padding: 12px 12px 12px 28px;
        font-size: 14px;
    }

    .rgb-inputs {
        gap: 6px;
    }

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

    .contrast-ratio-value {
        font-size: 36px;
    }

    .wcag-result-item {
        padding: 12px;
    }

    .contrast-action-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .colorblind-preview {
        height: 50px;
    }

    .suggestion-preview {
        height: 40px;
    }
}
