/* Mosaic Generator v1.0 - Styles */

/* Main Container */
.mosaic-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.mosaic-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.mosaic-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 10px;
}

.mosaic-header p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Sections */
.mosaic-section {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #0d6efd;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.section-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.section-content {
    padding: 10px 0;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 600px;
}

/* Image positioning canvas container — allow overflow so faded
   photo parts outside the working field are visible */
#imageCanvasContainer {
    overflow: visible;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container canvas {
    cursor: grab;
    display: block;
}

.canvas-container canvas:active {
    cursor: grabbing;
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
}

.controls-panel h5 {
    margin-bottom: 15px;
    font-weight: 600;
    color: #495057;
}

.controls-panel .btn {
    margin-bottom: 10px;
}

.info-box {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.info-box small {
    line-height: 1.8;
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card:nth-child(2) .stat-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) .stat-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
}

/* Color Breakdown */
.color-breakdown-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.color-breakdown {
    display: grid;
    gap: 12px;
}

.color-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
    margin-right: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-info {
    flex-grow: 1;
}

.color-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.color-stats {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    font-size: 1.2rem;
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
}

/* Form Elements */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn-lg {
    padding: 12px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-group .btn {
    min-width: 150px;
}

/* Alert Styling */
.alert {
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .mosaic-container {
        padding: 10px;
    }
    
    .mosaic-header h1 {
        font-size: 1.8rem;
    }
    
    .canvas-container {
        min-height: 400px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .controls-panel {
        margin-top: 20px;
    }
}

/* Scrollbar Styling */
.color-breakdown-container::-webkit-scrollbar {
    width: 8px;
}

.color-breakdown-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.color-breakdown-container::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.color-breakdown-container::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.text-center { text-align: center; }
