/* Mosaic Editor Styles */
.mosaic-editor-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mosaic-upload-section {
    margin-bottom: 30px;
}

.mosaic-upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mosaic-upload-area:hover {
    border-color: #5a6fd8;
    background: linear-gradient(135deg, #e8f2ff 0%, #d1e7ff 100%);
    transform: translateY(-2px);
}

.mosaic-upload-area.dragover {
    border-color: #4c63d2;
    background: linear-gradient(135deg, #d1e7ff 0%, #b8d4ff 100%);
}

.mosaic-upload-content .upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.mosaic-upload-content h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.mosaic-upload-content p {
    color: #666;
    margin-bottom: 5px;
    font-size: 1rem;
}

.upload-limit {
    font-size: 0.85rem !important;
    color: #888 !important;
}

/* Mosaic Editor Section */
.mosaic-editor-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.mosaic-controls {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    height: fit-content;
}

.control-group {
    margin-bottom: 25px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Tool Selector */
.tool-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.tool-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tool-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Emoji Selector */
.emoji-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 5px;
}

.emoji-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.emoji-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Edit Mode Selector */
.edit-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.radio-option:hover {
    background: #f8f9ff;
}

.radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.radio-option span {
    font-weight: 500;
    color: #333;
}

/* Selection Overlay */
.selection-overlay {
    position: absolute;
    border: 2px dashed #667eea;
    background: rgba(102, 126, 234, 0.1);
    pointer-events: none;
    z-index: 3;
}

.selection-handles {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    border: 1px solid white;
    cursor: pointer;
    z-index: 4;
}

.selection-handles.nw { top: -4px; left: -4px; cursor: nw-resize; }
.selection-handles.ne { top: -4px; right: -4px; cursor: ne-resize; }
.selection-handles.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.selection-handles.se { bottom: -4px; right: -4px; cursor: se-resize; }

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 45px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-buttons .btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-buttons .btn i {
    margin-right: 8px;
}

.action-buttons .btn.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border-color: #f39c12;
}

.action-buttons .btn.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d68910);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* Canvas Container */
.mosaic-canvas-container {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mosaic-canvas {
    max-width: 100%;
    max-height: 600px;
    border-radius: 10px;
    cursor: crosshair;
    display: block;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Selection Visual Enhancement */
.selection-indicator {
    position: absolute;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
    border-radius: 4px;
    pointer-events: none;
    z-index: 3;
}

/* Tool Button Active State Enhancement */
.tool-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Emoji Button Active State Enhancement */
.emoji-btn.active {
    border-color: #667eea;
    background: #667eea;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Info Section */
.mosaic-info-section {
    margin-top: 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.info-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.info-item h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item h3 i {
    color: #667eea;
    font-size: 1.2rem;
}

.info-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mosaic-editor-container {
        padding: 10px;
    }
    
    .mosaic-upload-area {
        padding: 30px 15px;
        min-height: 150px;
    }
    
    .mosaic-upload-content .upload-icon {
        font-size: 3rem;
    }
    
    .mosaic-upload-content h3 {
        font-size: 1.3rem;
    }
    
    .mosaic-editor-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mosaic-controls {
        padding: 20px;
    }
    
    .tool-selector {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .tool-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .emoji-selector {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    
    .emoji-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .edit-mode-selector {
        flex-direction: row;
        gap: 15px;
    }
    
    .radio-option {
        flex: 1;
        justify-content: center;
        padding: 6px 10px;
    }
    
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 0;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-item {
        padding: 20px;
    }
    
    .mosaic-canvas-container {
        min-height: 300px;
    }
}