/* Copyright (c) 2024-2026. Jericho Crosby (Chalwk) */

.canvas-wrap {
    position: relative;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: crosshair;
    display: block;
    background: transparent;
}

.picker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
    display: none;
}

.mode-btn {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    color: var(--gray);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-btn input {
    display: none;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.slider-row label {
    min-width: 30px;
    font-weight: 500;
    color: var(--dark);
    font-family: var(--font-mono), monospace;
}

.range {
    flex: 1;
}

.range input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gray-light), var(--light));
    outline: none;
    -webkit-appearance: none;
}

.range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.swatch-grid .sw {
    aspect-ratio: 1;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid var(--gray-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.swatch-grid .sw:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.swatch-grid .sw::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.app-margin-top {
    margin-top: 2rem;
}

.panel-custom {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.color-wheel-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.wheel-area {
    flex: 1;
    min-width: 300px;
}

.preview-section {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.preview-swatch {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-light);
    box-shadow: var(--shadow);
}

.hex-display {
    font-family: var(--font-mono), monospace;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--dark);
}

.small-info {
    color: var(--gray);
    font-size: 0.9rem;
}

.modes-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.controls-container {
    flex: 1;
    min-width: 300px;
}

.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.inputs-container {
    margin-bottom: 1.5rem;
}

.input-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label span {
    font-weight: 500;
    color: var(--dark);
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.hex-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
}

.readouts {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--font-mono), monospace;
    font-size: 0.9rem;
}

.actions-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.palette-heading {
    color: var(--dark);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
    padding-bottom: 0.5rem;
}

.palette-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .app-grid {
        grid-template-columns: 2fr 1fr;
    }

    .app-grid > section:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .canvas-wrap {
        width: 300px;
        height: 300px;
    }

    .color-wheel-layout {
        flex-direction: column;
    }

    .swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
}

@media (max-width: 480px) {
    .canvas-wrap {
        width: 250px;
        height: 250px;
    }

    .swatch-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .mode-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}