/* Coloring Book Plugin Styles */

.coloring-book-wrapper {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Original Image Section */
.coloring-original-section {
    text-align: center;
    margin-bottom: 30px;
}

.coloring-image-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coloring-original-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* Buttons */
.coloring-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.coloring-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.coloring-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.coloring-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.coloring-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.coloring-btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Coloring Interface */
.coloring-interface {
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coloring-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

/* Color Palette */
.coloring-palette-section {
    margin-bottom: 30px;
}

.coloring-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 10px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.coloring-color {
    width: 45px;
    height: 45px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.coloring-color:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.coloring-color.active {
    border-color: #2d3748;
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.coloring-color.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Tools */
.coloring-tools-section {
    margin-bottom: 30px;
}

.coloring-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.coloring-tool {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.coloring-tool:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.coloring-tool.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.coloring-tool svg {
    width: 20px;
    height: 20px;
}

/* Brush Size Control */
.brush-size-control {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #667eea;
}

.brush-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
    font-weight: 500;
}

.brush-size-label svg {
    color: #667eea;
}

.brush-size-value {
    color: #667eea;
    font-size: 16px;
}

.brush-size-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #e2e8f0 0%, #667eea 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.brush-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

.brush-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.brush-size-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
}

.brush-size-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.brush-size-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #718096;
}

.brush-size-marks span {
    opacity: 0.7;
}

/* Canvas Section */
.coloring-canvas-section {
    margin-bottom: 30px;
}

.coloring-canvas-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: auto;
}

.coloring-canvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

.coloring-canvas.brush-mode {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="%23667eea" opacity="0.5"/></svg>') 12 12, crosshair;
}

/* Loading State */
.coloring-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #667eea;
    font-size: 16px;
}

.coloring-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .coloring-book-wrapper {
        padding: 15px;
    }
    
    .coloring-palette {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 8px;
        padding: 15px;
    }
    
    .coloring-color {
        width: 40px;
        height: 40px;
    }
    
    .coloring-tools {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .coloring-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .coloring-section-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .coloring-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .coloring-btn {
        width: 100%;
        justify-content: center;
    }
    
    .coloring-palette {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
    }
    
    .coloring-color {
        width: 35px;
        height: 35px;
    }
}

/* Print Styles */
@media print {
    .coloring-buttons,
    .coloring-palette-section,
    .coloring-tools-section {
        display: none;
    }
    
    .coloring-canvas {
        border: none;
        box-shadow: none;
    }
}
