@import url('https://fonts.googleapis.com/css2?family=Vazir&display=swap');

/* ============================================
   RESET & GENERAL
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e272e 0%, #2c3e50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(155, 89, 182, 0.1) 0%, transparent 50%);
    z-index: -1;
}

/* ============================================
   CONTAINER & CARDS
   ============================================ */
.container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 30px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}
.back-home:hover {
    background: rgba(52, 152, 219, 0.8);
    transform: translateX(-5px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 30px;
    transition: transform 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
}

/* ============================================
   PROFILE HEADER & AVATAR
   ============================================ */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #3498db, #8e44ad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #3498db;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-edit-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

#userNameDisplay {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 5px;
}
.user-email {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* ============================================
   FORMS
   ============================================ */
.profile-form,
.settings-section {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group label i {
    margin-left: 8px;
    color: #3498db;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.2);
}
.form-group textarea {
    resize: vertical;
    font-family: inherit;
}
.form-group small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    display: block;
    margin-top: 5px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: scale(1.02);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}
.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* ============================================
   ICON BUTTONS (برای کارت آگهی)
   ============================================ */
.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    text-decoration: none;
    color: #fff;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

.edit-ad {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}
.edit-ad:hover {
    background: rgba(52, 152, 219, 0.4);
}

.delete-ad {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}
.delete-ad:hover {
    background: rgba(231, 76, 60, 0.4);
}

.toggle-status {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}
.toggle-status:hover {
    background: rgba(52, 152, 219, 0.3);
}
.toggle-status[data-status="active"]:hover {
    background: rgba(231, 76, 60, 0.3);
}
.toggle-status[data-status="inactive"]:hover {
    background: rgba(46, 204, 113, 0.3);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
}
.message.success {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid #2ed573;
}
.message.error {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid #ff4757;
}

/* ============================================
   DASHBOARD TABS
   ============================================ */
.dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 25px;
    padding-bottom: 12px;
    max-height: 120px;
    overflow-y: auto;
}
.dashboard-tabs::-webkit-scrollbar {
    width: 4px;
}
.dashboard-tabs::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: 'Vazir', sans-serif;
}
.tab-btn i {
    font-size: 0.9rem;
}
.tab-btn.active {
    background: rgba(52, 152, 219, 0.3);
    color: #fff;
}
.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s;
}

/* ============================================
   ADS LIST
   ============================================ */
.ads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.ad-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: 0.3s;
}
.ad-card:hover {
    background: rgba(0, 0, 0, 0.5);
}
.ad-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
}
.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ad-info {
    flex: 2;
}
.ad-info h4 {
    margin: 0 0 5px;
    color: #fff;
}
.ad-category,
.ad-price,
.ad-status,
.ad-views {
    font-size: 0.8rem;
    margin: 3px 0;
    color: #ccc;
}
.ad-status.active {
    color: #2ed573;
}
.ad-status.inactive {
    color: #ffa502;
}
.ad-actions {
    display: flex;
    gap: 10px;
}

.empty-ads {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.7);
}
.empty-ads i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}
.stat-card i {
    font-size: 2.5rem;
    color: #3498db;
}
.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
}
.stat-label {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   MESSAGES LIST
   ============================================ */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px 0;
}

.message-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 18px 20px;
    transition: 0.3s;
    border-right: 4px solid #3498db;
}
.message-item:hover {
    background: rgba(0, 0, 0, 0.5);
}
.message-item .message-subject {
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.05rem;
}
.message-item .message-body {
    color: #bdc3c7;
    font-size: 0.95rem;
    line-height: 1.6;
}
.message-item .message-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 8px;
    flex-wrap: wrap;
}
.message-item .message-meta .text-success {
    color: #2ecc71;
}
.message-item .message-meta .text-warning {
    color: #f39c12;
}
.message-item .message-reply {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(46, 204, 113, 0.08);
    border-right: 3px solid #2ecc71;
    border-radius: 12px;
}
.message-item .message-reply .reply-label {
    color: #2ecc71;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.message-item .message-reply .reply-text {
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.6;
}
.message-item.status-replied {
    border-right-color: #2ecc71;
}
.message-item.status-unread {
    border-right-color: #e74c3c;
}

/* ============================================
   ORDERS LIST
   ============================================ */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px 0;
}

.order-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 18px 20px;
    border-right: 4px solid #3498db;
    transition: 0.3s;
}
.order-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

.order-item.status-pending {
    border-right-color: #f39c12;
}
.order-item.status-confirmed {
    border-right-color: #3498db;
}
.order-item.status-shipped {
    border-right-color: #9b59b6;
}
.order-item.status-completed {
    border-right-color: #2ecc71;
}
.order-item.status-cancelled {
    border-right-color: #e74c3c;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.order-id {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}
.order-item.status-pending .status-badge {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}
.order-item.status-confirmed .status-badge {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}
.order-item.status-shipped .status-badge {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}
.order-item.status-completed .status-badge {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}
.order-item.status-cancelled .status-badge {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-ad {
    display: flex;
    gap: 15px;
    align-items: center;
}
.order-ad-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    background: #0f172a;
}
.order-ad-info h4 {
    color: #fff;
    margin: 0 0 4px 0;
}
.order-ad-info p {
    color: #bdc3c7;
    margin: 2px 0;
    font-size: 0.9rem;
}

.order-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}
.order-meta i {
    margin-left: 4px;
}

.order-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.btn-order-action {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.85rem;
}
.btn-order-action.confirm-order {
    background: #2ecc71;
    color: #fff;
}
.btn-order-action.confirm-order:hover {
    background: #27ae60;
}
.btn-order-action.cancel-order {
    background: #e74c3c;
    color: #fff;
}
.btn-order-action.cancel-order:hover {
    background: #c0392b;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-title {
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

.settings-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
}
.settings-section h3 {
    color: #fff;
    margin-bottom: 20px;
    border-right: 4px solid #3498db;
    padding-right: 15px;
}

.danger-section {
    border: 1px solid rgba(231, 76, 60, 0.5);
    background: rgba(231, 76, 60, 0.1);
}
.danger-section h3 {
    color: #e74c3c;
    border-right-color: #e74c3c;
}
.danger-title {
    color: #e74c3c;
    margin-top: 30px;
    border-right-color: #e74c3c;
}

.settings-card {
    padding: 25px;
}
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 25px;
    padding-bottom: 10px;
}
.settings-tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: 0.3s;
}
.settings-tab-btn.active {
    background: rgba(52, 152, 219, 0.4);
    color: white;
}
.settings-tab-content {
    display: none;
}
.settings-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

.theme-options {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #3498db;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

.form-control {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 12px;
    color: white;
    width: 100%;
    margin-top: 8px;
}
.mt-3 {
    margin-top: 20px;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: #2c3e50;
    border-radius: 24px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    color: white;
}
.modal-content h3 {
    margin-bottom: 15px;
}
.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .glass-card {
        padding: 20px;
    }
    .avatar {
        width: 90px;
        height: 90px;
        font-size: 3.5rem;
    }
    .form-actions {
        flex-direction: column;
    }
    .btn {
        justify-content: center;
    }
}