/* General container for the mosaic tool */
.mosaic-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Page Header */
.mosaic-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.mosaic-header h1 {
    font-size: 2.5em;
    color: #333;
    margin: 0;
}

.mosaic-header p {
    font-size: 1.1em;
    color: #777;
    margin-top: 8px;
}

/* Main layout using Flexbox */
.mosaic-main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Columns for controls and canvas */
.controls-column {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-column {
    flex: 2;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
}

/* Styling for each step/section in the control column */
.control-section .step-header {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 12px;
    background-color: #1a73e8; /* Main site blue */
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    border-radius: 50%;
}

.control-box {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
}

/* File Input Styling */
.file-input {
    font-family: inherit;
    font-size: 14px;
    color: #555;
}

.file-input::file-selector-button {
    background-color: #eef2ff;
    border: 1px solid #1a73e8;
    color: #1a73e8;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 15px;
}

.file-input::file-selector-button:hover {
    background-color: #e0e7ff;
}

/* Image Preview */
.preview-container {
    margin-top: 0;
    border-top: 1px solid #eee;
    padding-top: 0;
}

.preview-container p {
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.preview-container img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin: auto;
}

.image-count {
    color: #777;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Slider styling */
.slider-group {
    margin-bottom: 15px;
}

.slider-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.slider-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #1a73e8;
    border-radius: 50%;
}

.slider-value {
    text-align: center;
    color: #777;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Main action buttons */
.action-button {
    padding: 12px 30px;
    background-color: #1a73e8;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-align: center;
    width: 100%;
}

.action-button:hover:not(:disabled) {
    background-color: #0c5db4;
}

.action-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#download-btn {
    margin-top: 15px;
    width: auto; /* Allow download button to size to its content */
    background-color: #28a745; /* A green for success/download actions */
}

#download-btn:hover {
    background-color: #218838;
}

/* Canvas and progress bar */
#canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mosaic-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#progress-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

#progress-bar {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
}

#progress-bar::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 5px;
}

#progress-bar::-webkit-progress-value {
    background-color: #1a73e8;
    border-radius: 5px;
}

/* Error Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    font-size: 1.8em;
    color: #d93025; /* A fitting error red */
    margin: 0 0 15px 0;
}

.modal-content p {
    color: #555;
    margin-bottom: 25px;
}

.modal-close-button {
    background-color: #d93025;
    color: white;
    font-weight: bold;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-close-button:hover {
    background-color: #b92419;
}

/* Utility class */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .mosaic-main {
        flex-direction: column;
    }
}