/* Components: product image upload, preview, and media controls. */

/* استایل‌های مربوط به تصاویر محصولات */
.product-image-container {
    height: 200px; /* افزایش ارتفاع */
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    position: relative;
    margin-bottom: 10px;
}

.product-thumbnail {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--dark-gray);
    font-size: 1rem;
    text-align: center;
    padding: 20px;
}

.no-image i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.product-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.product-item:last-child {
    border-bottom: none;
}

.product-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* استایل‌های مربوط به آپلود تصویر */
.image-preview-container {
    margin-top: 10px;
}

.upload-progress {
    margin-top: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    color: white;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* استایل‌های مودال افزودن محصول */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.primary-btn {
    background-color: #4CAF50;
    color: white;
    width: 100%;
    margin-top: 10px;
}

/* استایل‌های پیش‌نمایش تصویر */
.image-preview-container {
    margin-top: 10px;
    text-align: center;
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.preview-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.preview-remove-btn.hidden {
    display: none;
}

.image-preview-list {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.image-preview-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
}

.upload-progress {
    margin-top: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    color: white;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

