﻿/* ============================================
   Ad Edit Page Styles
   ترکیب استایل‌های قدیمی با جدید
   ============================================ */

/* استایل‌های قدیمی از style_ads.min.css */
.adImage {
    width: 100%;
}

.adItems img {
    object-fit: contain !important;
    height: 152px;
}

.adItems .pro-item {
    height: auto;
    border: 1px solid #cbcbcb;
    border-radius: 7px;
}

.goodSidebarTitle {
    background-color: #b4b4b4;
    color: #fff;
    width: 100%;
    font-size: 20px;
    padding: 10px;
    margin-bottom: 0;
    letter-spacing: 1px;
}

.boxB {
    border: 2px solid #fff;
    width: 74px;
    height: 34px;
    padding: 1px;
    border-radius: 7px;
}

.boxA {
    border-bottom: 2px solid #cba98d;
    border-right: 2px solid #cba98d;
    width: 78px;
    height: 38px;
    border-radius: 7px;
    margin-bottom: 15px;
}

.boxC {
    width: 70px;
    height: 30px;
    background-color: #ee9200;
    border-radius: 7px;
    text-align: left;
    padding-left: 15px;
    font-size: 20px;
    font-family: tohoma;
}

    .boxC .fa-flash {
        font-size: 44px;
    }

.viewAdvertiser {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

    .viewAdvertiser i {
        font-size: 20px;
        margin-left: 10px;
        color: #ff5707 !important;
    }

    .viewAdvertiser span {
        font-weight: 500;
        color: #333;
    }

    .viewAdvertiser .link-style {
        color: #3498db;
        text-decoration: none;
    }

        .viewAdvertiser .link-style:hover {
            text-decoration: underline;
        }

    .viewAdvertiser a {
        font-weight: bold;
    }

.pro-item.pro_ad > a[data-thunder]:not([data-thunder="0"]):after {
    content: "\E046\00FE0E"; /* FontAwesome flash icon */
    font-family: "iconFont";
    color: #ffd700;
    font-size: 16px;
    position: absolute;
    top: 0;
    right: 5px;
    z-index: 10;
    text-shadow: 0 0 2px black;
}

.datepro {
    text-align: right;
}

.explain {
    font-size: 16px;
    padding: 0 18px;
}

/* استایل‌های جدید برای صفحه ویرایش */

/* Border برای آگهی موجود */
.ad_border {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #f8f9fa;
}

/* دکمه‌های آگهی */
.ad_btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Dropzone Styles */
#dropzone {
    min-height: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #dee2e6;
}

    #dropzone:hover {
        background-color: #f8f9fa !important;
        border-color: var(--bs-primary) !important;
    }

    #dropzone.dragging {
        background-color: #e7f3ff !important;
        border-color: var(--bs-primary) !important;
        border-style: dashed;
    }

/* Image Preview */
#imagePreview .card {
    transition: transform 0.2s;
    border-radius: 0.5rem;
}

    #imagePreview .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    #imagePreview .card img {
        height: 150px;
        object-fit: cover;
        border-radius: 0.5rem 0.5rem 0 0;
    }

/* Form Enhancements */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

    .form-label .text-danger {
        font-size: 1.2em;
    }

/* Select2 RTL Support */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    min-height: 38px;
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 36px;
        padding-right: 12px;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: var(--bs-primary);
        border-color: var(--bs-primary);
        color: black;
        padding: 0 8px;
        margin: 4px;
        border-radius: 0.25rem;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
        color: white;
        margin-left: 5px;
    }

/* Price Input */
.price-input {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Loading State */
.btn.loading {
    position: relative;
    pointer-events: none;
}

    .btn.loading::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 16px;
        top: 50%;
        left: 10px;
        margin-left: -8px;
        margin-top: -8px;
        border: 2px solid transparent;
        border-radius: 50%;
        border-top-color: currentColor;
        animation: spinner 0.6s linear infinite;
    }

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Status Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

/* Alert Enhancements */
.alert {
    border-radius: 0.5rem;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

/* Card Improvements */
.card {
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Sticky Sidebar */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        z-index: 1020;
    }
}

/* Form Switch Custom */
.form-switch {
    padding-right: 2.5em;
}

    .form-switch .form-check-input {
        width: 3em;
        margin-right: -2.5em;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280,0,0,0.25%29'/%3e%3c/svg%3e");
    }

        .form-switch .form-check-input:checked {
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
        }

/* Input Group Enhancements */
.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* Validation Feedback */
.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-left: calc(1.5em + 0.75rem);
}

.was-validated .form-control:valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-left: calc(1.5em + 0.75rem);
}

/* Modal Enhancements */
.modal-content {
    border-radius: 0.75rem;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    #imagePreview .card img {
        height: 120px;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

        .btn-group .btn {
            width: 100%;
        }

    .ad_btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .btn,
    #dropzone,
    .modal {
        display: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Helper Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Progress Bar for Upload */
.upload-progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar {
    height: 100%;
    background-color: var(--bs-primary);
    transition: width 0.3s ease;
}

/* RTL Specific Fixes */
[dir="rtl"] .select2-selection__choice__remove {
    margin-right: 5px;
    margin-left: 0;
}

[dir="rtl"] .input-group-text {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* صفحه راهنما */
.mypolicy {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

    .mypolicy h6 {
        color: #495057;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .mypolicy ul {
        list-style: none;
        padding-right: 0;
    }

        .mypolicy ul li {
            padding: 0.5rem 0;
            border-bottom: 1px solid #dee2e6;
        }

            .mypolicy ul li:last-child {
                border-bottom: none;
            }

/* استایل دکمه آپلود */
.PublicBoxPage2 {
    margin-top: 1rem;
}


/* ===== Gallery Styles for Ad Detail ===== */

.dtimg1 img {
    filter: invert(0%) sepia(75%);
    opacity: 0.6;
}

.dtimg1 {
    width: 34px;
    display: inline-block;
    top: 22px;
    position: absolute;
    right: 0px;
}

/* Swiper Containers */
.swiper-container.s_top {
    min-height: 422px;
}

/* Thumbnail Styles */
.s_bottom .tumb {
    /* border: 1px solid silver; */
    border-radius: 5px;
    margin-top: 8px;
    width: 61.6667px;
    margin-left: 5px;
}

    .s_bottom .tumb.active {
        /* border: 1px solid #606060; */
    }

    .s_bottom .tumb img {
        width: 100% !important;
        cursor: pointer;
        padding: 4px;
        width: 60px;
        height: 66px;
    }

/* Figure and Image Styles */
.swiper-zoom-container figure {
    margin: 0;
}

.swiper-zoom-container figcaption {
    text-align: center;
    font-size: 13px;
    padding-top: 6px;
}

/* Lazy Loading Placeholder */
.swiper-lazy {
    background: #f0f0f0;
}

/* LightGallery Compatibility */
.lightGallery {
    cursor: zoom-in;
}

/* Navigation Buttons */
.s_top .swiper-button-next,
.s_top .swiper-button-prev,
.mySwiper_bt .swiper-button-next,
.mySwiper_bt .swiper-button-prev {
    color: #4285f4;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .swiper-container.s_top {
        min-height: 300px;
    }

    .s_bottom .tumb {
        width: 50px;
        margin-left: 3px;
    }

        .s_bottom .tumb img {
            width: 50px;
        }
}

.ad-item-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .ad-item-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

.ad-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ad-item-image {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background: #f5f5f5;
}

    .ad-item-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.ad-thunder-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.ad-item-body {
    padding: 12px;
}

.ad-item-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ad-item-price {
    color: #2ecc71;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.ad-item-meta {
    font-size: 12px;
    color: #999;
}
