/* assets/css/my-ads.css */

/* ================= صفحه آگهی‌های من ================= */
.myads-container {
    padding: 30px 0 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ================= بریدکرامب ================= */
.breadcrumb {
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: var(--gray, #6b7280);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb .separator {
    font-size: 0.7rem;
    color: var(--border, #e5e7eb);
}

/* ================= هدر ================= */
.myads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.myads-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark, #1e1e1e);
    margin-bottom: 8px;
}

.myads-subtitle {
    font-size: 1rem;
    color: var(--gray, #6b7280);
}

.btn-create-ad {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary, #3396D3);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-create-ad:hover {
    background: var(--primary-hover, #2a73a8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 150, 211, 0.3);
}

/* ================= تب‌ها ================= */
.myads-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.myad-tab {
    padding: 10px 24px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 30px;
    background: white;
    color: var(--gray, #6b7280);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.myad-tab:hover {
    border-color: var(--primary, #3396D3);
    color: var(--primary, #3396D3);
}

.myad-tab.active {
    background: var(--primary, #3396D3);
    color: white;
    border-color: var(--primary, #3396D3);
}

/* ================= لیست آگهی‌ها ================= */
.myads-list {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

/* کارت آگهی */
.myad-card {
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .myad-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.myad-card:hover {
    box-shadow: 0 10px 25px rgba(51, 150, 211, 0.1);
    border-color: var(--primary, #3396D3);
}

.myad-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--light, #f9fafb);
}

.myad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.myad-info {
    flex: 1;
}

.myad-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark, #1e1e1e);
}

.myad-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--gray, #6b7280);
    margin-bottom: 8px;
}

.myad-meta i {
    color: var(--primary, #3396D3);
    margin-left: 4px;
}

.myad-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
}

.myad-stat {
    background: var(--light, #f9fafb);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--gray, #6b7280);
}

.myad-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
    background: white;
    color: var(--gray, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--primary, #3396D3);
    color: white;
    border-color: var(--primary, #3396D3);
}

.btn-icon.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.btn-text {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border, #e5e7eb);
    background: white;
    color: var(--dark, #1e1e1e);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-text:hover {
    background: var(--light, #f9fafb);
    border-color: var(--primary, #3396D3);
    color: var(--primary, #3396D3);
}

/* ================= حالت‌های صفحه ================= */
.state-box {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--border, #e5e7eb);
    margin: 40px auto;
    max-width: 600px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #3396D3);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.error-state i {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 20px;
}

.error-state h3 {
    color: #b91c1c;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray, #6b7280);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--dark, #1e1e1e);
    margin-bottom: 15px;
}

.access-denied i {
    font-size: 4rem;
    color: #f59e0b;
    margin-bottom: 20px;
}

.access-denied h3 {
    color: #b45309;
    margin-bottom: 15px;
}

.btn-retry {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary, #3396D3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-retry:hover {
    background: var(--primary-hover, #2a73a8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 150, 211, 0.3);
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary, #3396D3);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover, #2a73a8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 150, 211, 0.3);
}

.btn-outline {
    display: inline-block;
    padding: 12px 30px;
    background: white;
    color: var(--primary, #3396D3);
    border: 2px solid var(--primary, #3396D3);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--primary, #3396D3);
    color: white;
}

/* ================= صفحه‌بندی ================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--dark, #1e1e1e);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 10px;
}

.page-btn:hover:not(.active):not(.disabled) {
    background: var(--light, #f9fafb);
    border-color: var(--primary, #3396D3);
    color: var(--primary, #3396D3);
}

.page-btn.active {
    background: var(--primary, #3396D3);
    border-color: var(--primary, #3396D3);
    color: #fff;
    cursor: default;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-dots {
    color: var(--gray, #6b7280);
    padding: 0 5px;
}

/* ================= مودال ================= */
.myad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.myad-modal .modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.modal-header h3 {
    margin: 0;
    color: var(--dark, #1e1e1e);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray, #6b7280);
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--light, #f9fafb);
    color: var(--dark, #1e1e1e);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border, #e5e7eb);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.delete-modal .warning-text {
    color: #b91c1c;
    font-size: 0.9rem;
    margin: 10px 0;
    text-align: center;
}

/* ================= جزئیات آگهی ================= */
.ad-detail-item {
    display: flex;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--light, #f9fafb);
    border-radius: 10px;
}

.ad-detail-label {
    width: 120px;
    font-weight: 600;
    color: var(--gray, #6b7280);
}

.ad-detail-value {
    flex: 1;
    color: var(--dark, #1e1e1e);
}

.ad-detail-value.id {
    direction: ltr;
    font-family: monospace;
    background: white;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

.detail-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #e5e7eb);
}

.detail-section h4 {
    margin-bottom: 15px;
    color: var(--dark, #1e1e1e);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.gallery-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================= فرم ویرایش وضعیت ================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark, #1e1e1e);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary, #3396D3);
    box-shadow: 0 0 0 3px rgba(51,150,211,0.1);
}

/* ================= ریسپانسیو ================= */
@media (max-width: 768px) {
    .myads-container {
        padding: 0 20px;
    }

    .myads-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .myads-title {
        font-size: 1.8rem;
    }

    .btn-create-ad {
        width: 100%;
        justify-content: center;
    }

    .myad-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .myad-meta {
        flex-direction: column;
        gap: 8px;
    }

    .myad-actions {
        justify-content: flex-start;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .myads-title {
        font-size: 1.5rem;
    }

    .myad-stats {
        flex-direction: column;
        gap: 5px;
    }

    .myad-actions {
        flex-wrap: wrap;
    }

    .btn-text {
        width: 100%;
        justify-content: center;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}