/* =========================
   Ads container
========================= */
.sam-ads-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* =========================
   Ad box
========================= */
.sam-ad {
    background: #ffffff;
    border-radius: 16px;
    padding: 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* =========================
   Header
========================= */
.sam-ad-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sam-ad-avatar img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.sam-ad-author {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

/* =========================
   Media
========================= */
.sam-ad img,
.sam-ad video {
    max-height: 80vh;
    width: 100%;
    object-fit: contain;
    border-radius: 6px;
    margin: 0;
}

/* =========================
   Text
========================= */
.sam-ad p {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    margin: 0;
}

/* =========================
   Actions container
========================= */
.sam-ad-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f5f6f8;
    padding: 10px 12px;
    border-radius: 12px;
    margin-top: 12px;
    font-size: 18px;
    flex-wrap: nowrap;
}

.sam-ad-actions span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* =========================
   Icons
========================= */
.sam-like-btn,
.sam-reply-btn,
.sam-save-btn,
.sam-flag-btn,
.sam-delete-ad,
.sam-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.sam-like-icon,
.sam-reply-icon,
.sam-save-icon,
.sam-flag-icon,
.sam-share-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* =========================
   Counters
========================= */
.sam-like-count,
.sam-reply-count,
.sam-save-count,
.sam-flag-count {
    font-size: 13px;
    line-height: 1;
}

.sam-like-count {
    font-weight: 600;
    cursor: pointer;
}

/* =========================
   Actions order logic
========================= */

/* Default pages → Save at right */
.sam-ad:not(.sam-my-ad) .sam-save-btn {
    order: 99;
}



/* My Ads → Save before Delete */
.sam-my-ad .sam-save-btn {
    order: 90;
}

/* Other actions */
.sam-like-btn  { order: 1; }
.sam-reply-btn { order: 2; }
.sam-flag-btn  { order: 3; }

/* =========================
   Likes list
========================= */
.sam-likes-list {
    margin-top: 8px;
    padding: 8px;
    background: #f7f7f7;
    border-radius: 8px;
    font-size: 13px;
}


.sam-like-user:last-child {
    border-bottom: none;
}
.sam-like-user {
    display: block;
    padding: 4px 0;
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.sam-like-user:hover {
    text-decoration: underline;
}


/* =========================
   Video
========================= */
.sam-video-wrapper {
    position: relative;
}

.sam-video {
    width: 100%;
    display: block;
    background: #000;
}

.sam-video-sound-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.sam-video-sound-toggle img {
    width: 12px;
    height: 12px;
    pointer-events: none;
}

/* =========================
   Filters
========================= */
.sam-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* City filter */
.sam-city-filter {
    position: relative;
}

.sam-city-selected {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.sam-city-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 180px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 99;
}

.sam-city-search {
    width: calc(100% - 16px);
    margin: 8px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.sam-city-dropdown div[data-city] {
    padding: 8px 10px;
    cursor: pointer;
}

.sam-city-dropdown div[data-city]:hover {
    background: #f0f0f0;
}

/* Category filter */
.sam-category-filter {
    display: flex;
    gap: 8px;
}

.sam-cat-item {
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    background: #f5f5f5;
    text-decoration: none;
    line-height: 1;
}

.sam-cat-item.active {
    background: #0073aa;
    color: #fff;
}

/* =========================
   Replies
========================= */
.sam-reply {
    margin-top: 8px;
}

.sam-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}

.sam-reply-body {
    display: none;
    border-left: 2px solid #ccc;
    padding-left: 10px;
    margin-top: 5px;
}

.sam-reply-body p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* =========================
   Add Ad Steps
========================= */
.sam-category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
    gap: 10px;
}

.sam-category-cards label {
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background: #f9f9f9;
}

.sam-category-cards input {
    display: none;
}

.sam-category-cards input:checked + span {
    font-weight: bold;
    color: #0073aa;
}

.sam-text-hint {
    font-size: 13px;
    color: #777;
    margin-bottom: 6px;
}

/* =========================
   Confirm text button
========================= */
.sam-confirm-text {
    margin-top: 8px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.sam-confirm-text:disabled {
    background: #ccc;
    cursor: not-allowed;
}
/* =========================
   Categories
========================= */
.sam-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sam-category-list label {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    background: #f9f9f9;
}

/* =========================
   Steps
========================= */
.sam-step textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.sam-step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

/* =========================
   Media upload
========================= */
.sam-media-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    padding: 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    color: #555;
}

.sam-media-upload span {
    font-size: 14px;
    margin-top: 6px;
}
/* =========================
   Upload progress
========================= */
.sam-upload-progress {
    margin-top: 15px;
}

.sam-upload-bar {
    width: 100%;
    height: 8px;
    background: #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.sam-upload-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0073aa, #00b3a4);
    transition: width 0.2s ease;
}

.sam-upload-percent {
    margin-top: 6px;
    font-size: 13px;
    text-align: center;
    color: #555;
}

/* =========================
   ایکون اد
========================= */


/* Floating button */
#sam-add-ad-fab {
    position: fixed;
    bottom: 50px;
    right: 17px;
    width: 36px;
    height: 36px;
    background: transparent;
    color: white;
    font-size: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* Modal */
#sam-add-ad-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.sam-add-ad-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.sam-add-ad-box {
    position: relative;
    background: #fff;
    max-width: 520px;
    width: 92%;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 12px;
    overflow-y: auto;
    padding: 16px;
}

.sam-add-ad-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   FIX: Delete icon size (ALL My Ads)
========================= */


/* container اکشن‌ها */
.sam-ad.sam-my-ad .sam-ad-actions {
    position: relative;   /* مرجع برای delete */
}

/* delete فقط بره راست */
.sam-ad.sam-my-ad .sam-delete-ad {
    position: absolute;
    right: 12px;          /* فاصله از راست */
    top: 50%;
    transform: translateY(-50%);
}

/* سایز delete */
.sam-ad.sam-my-ad .sam-delete-ad img {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain;
}

