/* Tools Styles - Color Splash Game */
/* Tool panel, brush tools, and color mixing interface */

.tools-panel {
    width: 160px; /* Further reduced from 180px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px; /* Further reduced from 12px */
    padding: 10px; /* Further reduced from 12px */
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.tools-panel::-webkit-scrollbar {
    width: 6px;
}

.tools-panel::-webkit-scrollbar-track {
    background: transparent;
}

.tools-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Tool sections */
.tool-section {
    margin-bottom: 12px; /* Further reduced from 15px */
    padding: 8px; /* Further reduced from 10px */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px; /* Further reduced from 10px */
    backdrop-filter: blur(10px);
}

.tool-section h3 {
    margin: 0 0 8px 0; /* Further reduced from 10px */
    font-size: 0.85em; /* Further reduced from 0.95em */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px; /* Further reduced from 5px */
}

/* Brush tools */
.brush-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px; /* Further reduced from 6px */
}

.tool-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 6px; /* Further reduced from 8px */
    padding: 6px 4px; /* Further reduced from 8px 5px */
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px; /* Further reduced from 3px */
    font-size: 0.68em; /* Further reduced from 0.75em */
    min-height: 50px; /* Further reduced from 60px */
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tool-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.tool-icon {
    font-size: 1.2em; /* Further reduced from 1.4em */
    display: block;
}

.tool-name {
    font-weight: 500;
    font-size: 0.68em; /* Further reduced from 0.75em */
}

/* Brush size controls */
.size-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#brush-size {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

#brush-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; /* Reduced from 20px */
    height: 18px; /* Reduced from 20px */
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

#brush-size::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

#brush-size::-moz-range-thumb {
    width: 18px; /* Reduced from 20px */
    height: 18px; /* Reduced from 20px */
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.size-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 10px; /* Reduced from 8px 12px */
    border-radius: 6px; /* Reduced from 8px */
}

#size-value {
    font-weight: 600;
    font-size: 1em; /* Reduced from 1.1em */
}

.size-preview {
    width: 18px; /* Reduced from 20px */
    height: 18px; /* Reduced from 20px */
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Color buttons */
.primary-colors,
.mixed-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 3px; /* Further reduced from 4px */
    justify-content: center;
}

.color-btn {
    width: 28px; /* Further reduced from 32px */
    height: 28px; /* Further reduced from 32px */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-color: white;
}

.color-btn.primary {
    border-width: 2px; /* Reduced from 3px */
    width: 32px; /* Further reduced from 36px */
    height: 32px; /* Further reduced from 36px */
}

.color-btn.highlighted {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.color-btn.mixed {
    border-color: #4ecdc4;
    position: relative;
}

.color-btn.mixed::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8em;
    background: #4ecdc4;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Color mixing lab */
.color-mixer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
}

.mix-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 8px;
}

.mix-slot {
    width: 60px;
    height: 60px;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
}

.mix-slot:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.2);
}

.mix-slot.drag-over {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.2);
    transform: scale(1.05);
}

.mix-label {
    font-size: 0.7em;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    width: 100%;
    word-wrap: break-word;
}

.mix-operator,
.mix-equals {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    margin: 0 5px;
}

.mix-result {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
}

.mix-result.mixing-animation {
    animation: mix-sparkle 1s ease;
}

@keyframes mix-sparkle {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.result-label {
    font-size: 1.5em;
    color: rgba(255, 255, 255, 0.8);
}

.btn-mix {
    width: 100%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-mix:hover:not(:disabled) {
    background: linear-gradient(135deg, #44a08d, #4ecdc4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-mix:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

.color-fact {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 10px;
    display: none;
    animation: fade-in 0.5s ease;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mixed colors palette */
.mixed-colors {
    min-height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.mixed-colors:empty::after {
    content: 'Mixed colors will appear here!';
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

/* Drag and drop styles */
.color-btn[draggable="true"] {
    cursor: grab;
}

.color-btn[draggable="true"]:active {
    cursor: grabbing;
}

.color-btn.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Tool tooltips */
.color-tooltip {
    position: absolute;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: tooltip-appear 0.2s ease;
}

@keyframes tooltip-appear {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tooltip-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tooltip-content {
    display: flex;
    flex-direction: column;
}

.tooltip-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.tooltip-fact {
    font-size: 0.8em;
    opacity: 0.9;
}

/* Accessibility improvements */
.color-btn:focus {
    outline: 3px solid #4ecdc4;
    outline-offset: 2px;
}

.tool-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Large brush mode */
.large-brush-mode .color-btn {
    width: 55px;
    height: 55px;
}

.large-brush-mode .tool-btn {
    padding: 15px 10px;
    min-height: 90px;
}

.large-brush-mode .tool-icon {
    font-size: 2.2em;
}

/* High contrast mode */
.high-contrast .tools-panel {
    background: #000;
    border: 3px solid #fff;
    color: #fff;
}

.high-contrast .tool-section {
    background: #333;
    border: 1px solid #fff;
}

.high-contrast .color-btn {
    border-color: #fff;
    filter: contrast(150%);
}

.high-contrast .tool-btn {
    background: #333;
    border-color: #fff;
    color: #fff;
}

.high-contrast .tool-btn.active {
    background: #fff;
    color: #000;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .tools-panel {
        width: 100%;
        max-height: none;
        border-radius: 15px 15px 0 0;
        margin-top: 10px;
    }
    
    .brush-tools {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tool-btn {
        padding: 15px 10px;
        min-height: 90px;
    }
    
    .tool-icon {
        font-size: 2em;
    }
    
    .color-btn {
        width: 50px;
        height: 50px;
    }
    
    .mix-area {
        justify-content: center;
    }
    
    .mix-slot,
    .mix-result {
        width: 50px;
        height: 50px;
    }
}

/* Landscape mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .tools-panel {
        width: 250px;
        max-height: 70vh;
    }
    
    .brush-tools {
        grid-template-columns: 1fr 1fr;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tool-btn,
    .color-btn,
    .mix-result,
    .color-fact {
        animation: none;
        transition: none;
    }
    
    .color-btn:hover,
    .tool-btn:hover {
        transform: none;
    }
}
