/* Create/Edit Page Styles */
/* GLOBAL IMAGE RESET - Force all images in upload area to be small */
.uploaded-images img,
.uploaded-image img,
#uploadedImages img,
img[src^="data:image"] {
    width: 100px !important;
    height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Step indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 1;
}

.step:last-child::before {
    display: none;
}

.step.active::before {
    background-color: #0d6efd;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background-color: #0d6efd;
    color: white;
}

.step.completed .step-number {
    background-color: #198754;
    color: white;
}

/* Form sections */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Image upload area */
.image-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.image-upload-area.dragover {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.uploaded-image {
    position: relative !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    display: inline-block !important;
    width: 100px !important;
    height: 100px !important;
    flex-shrink: 0 !important;
}

.uploaded-image .image-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 0.25rem;
}

.uploaded-image .image-actions button {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 12px;
}

.uploaded-image .image-actions button:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* Price input styling */
.price-input-group {
    position: relative;
}

.price-input-group::before {
    content: '฿';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-weight: 500;
    z-index: 10;
}

.price-input-group input {
    padding-left: 2rem;
}

/* Form visibility fixes */
.form-control, .form-select, textarea {
    display: block;
    visibility: visible;
    opacity: 1;
    border: 2px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 1rem;
    background: white;
    color: #495057;
}

/* Ensure input-group works correctly with Bootstrap */
.input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
}

.input-group .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 0.375rem 0 0 0.375rem;
    background-color: #f8f9fa;
}

.input-group .form-control {
    border-radius: 0;
}

.input-group .btn {
    border-radius: 0 0.375rem 0.375rem 0;
}

.form-check-input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 1rem !important;
    height: 1rem !important;
    background: white !important;
    color: #0d6efd !important;
}

/* Form section styling */
.form-section {
    background: #f8f9fa !important;
    padding: 2rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 2rem !important;
    border: 1px solid #e9ecef !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.form-section h5 {
    color: #0d6efd !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 3px solid #0d6efd !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Form styling */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block !important;
    visibility: visible !important;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

/* Form check styling */
.form-check {
    padding: 1rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
    transition: background-color 0.15s ease-in-out;
    display: block !important;
    visibility: visible !important;
}

.form-check:hover {
    background-color: #f8f9fa;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* Image preview styling */
.image-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 2px solid #e9ecef;
    transition: border-color 0.15s ease-in-out;
}

.image-preview:hover {
    border-color: #0d6efd;
}

/* Image item styling */
.image-item {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: white;
    transition: box-shadow 0.15s ease-in-out;
}

.image-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Button actions */
.btn-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 2rem 0;
    border-top: 2px solid #e9ecef;
    margin-top: 2rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

/* Upload area styling */
.upload-area {
    border: 2px dashed #0d6efd;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: background-color 0.15s ease-in-out;
}

.upload-area:hover {
    background: #e9ecef;
}

.upload-area i {
    font-size: 3rem;
    color: #0d6efd;
    margin-bottom: 1rem;
}

/* Form display utilities */
.display-none {
    display: none !important;
}

.display-block {
    display: block !important;
}

.visibility-visible {
    visibility: visible !important;
}

.opacity-1 {
    opacity: 1 !important;
}

/* Width utilities */
.width-100 {
    width: 100% !important;
}

.max-width-400 {
    max-width: 400px;
}

/* Input styling */
.input-display-none {
    display: none;
}

/* Button utilities */
.btn-display-none {
    display: none;
}

/* Icon utilities */
.icon-2rem {
    font-size: 2rem;
}

/* Form card styling */
.form-check-card label {
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-card label:hover {
    background-color: #f8f9fa !important;
}

.form-check-card input:checked + label {
    border-color: #0d6efd !important;
    background-color: #f8f9fa !important;
}
