/* ریست و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white-color: #ffffff;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Tahoma', 'Vazir', sans-serif;
    background: var(--light-color);
    color: var(--text-color);
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* نوار بالای صفحه */
.top-bar {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-left: 20px;
}

.contact-info i {
    margin-left: 5px;
}

.social-links a {
    color: var(--white-color);
    margin-left: 15px;
    font-size: 18px;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
}

/* هدر */
.header {
    background: var(--white-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: var(--shadow);
}

.logo-text h1 {
    font-size: 26px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 14px;
    color: var(--text-color);
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--white-color);
    padding: 20px;
    gap: 15px;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text-color);
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu a:hover {
    background: var(--light-color);
}

/* دکمه‌ها */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--white-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white-color);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white-color);
}

.btn-lg {
    padding: 15px 35px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 13px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 80px 0;
    margin: 30px 0;
    border-radius: 20px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 30px;
}

.hero-features {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--success-color);
    font-weight: 500;
}

.feature-item i {
    font-size: 20px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* جعبه جستجو */
.search-section {
    margin: 40px 0;
}

.search-box-advanced {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 15px;
    background: var(--white-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.search-box-advanced input,
.search-box-advanced select {
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
}

.search-box-advanced input:focus,
.search-box-advanced select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.advanced-filters {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    background: var(--white-color);
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.advanced-filters.active {
    display: grid;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-color);
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input {
    flex: 1;
}

/* آمار */
.stats-section {
    margin: 50px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.stat-card {
    background: var(--white-color);
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--white-color);
    font-size: 30px;
}

.stat-number {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-color);
}

/* بخش‌ها */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 38px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-color);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.view-all:hover {
    gap: 12px;
}

/* دسته‌بندی‌ها */
.categories-section,
.featured-section,
.latest-section {
    margin: 60px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.category-card {
    background: var(--white-color);
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.category-card h4 {
    font-size: 20px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.category-card p {
    color: var(--text-color);
}

/* آگهی‌ها */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.listing-card {
    background: var(--white-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.listing-image {
    height: 220px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.listing-card:hover .listing-image img {
    transform: scale(1.1);
}

.listing-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(102, 126, 234, 0.9);
    color: var(--white-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.listing-content {
    padding: 25px;
}

.listing-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--dark-color);
    margin: 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-info {
    display: flex;
    justify-content: space-between;
    background: var(--light-color);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.listing-price {
    font-size: 26px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.listing-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.listing-actions button {
    flex: 1;
}

/* ویژگی‌ها */
.why-us-section {
    background: var(--white-color);
    padding: 80px 0;
    margin: 60px 0;
    border-radius: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 40px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: var(--white-color);
    font-size: 35px;
}

.feature-card h3 {
    font-size: 22px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-color);
    line-height: 1.8;
}

/* صفحات */
.page {
    display: none;
    min-height: 60vh;
    padding: 40px 0;
}

.page.active {
    display: block;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 42px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.content-box {
    background: var(--white-color);
    padding: 50px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.content-box h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin: 30px 0 20px;
}

.content-box h3 {
    font-size: 22px;
    color: var(--dark-color);
    margin: 25px 0 15px;
}

.content-box ul {
    margin: 20px 0 20px 30px;
}

.content-box li {
    margin: 10px 0;
    line-height: 1.8;
}

/* تماس با ما */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.contact-info-box,
.contact-form-box {
    background: var(--white-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.contact-item {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    align-items: center;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.contact-item h4 {
    font-size: 16px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.social-links-large {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.social-links-large a {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.social-links-large a:hover {
    transform: translateY(-3px);
}

.contact-form-box input,
.contact-form-box textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form-box input:focus,
.contact-form-box textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* پنل ادمین */
.admin-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    min-height: 70vh;
}

.admin-sidebar {
    background: var(--white-color);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.admin-sidebar h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 22px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-nav a {
    padding: 15px 20px;
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
}

.admin-content {
    background: var(--white-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* پروفایل */
.profile-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
}

.profile-sidebar {
    background: var(--white-color);
    border-radius: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.profile-header {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border-radius: 15px 15px 0 0;
}

.profile-nav {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-nav a {
    padding: 15px 20px;
    border-radius: 10px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-nav a:hover,
.profile-nav a.active {
    background: var(--light-color);
    color: var(--primary-color);
}

.profile-content {
    background: var(--white-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.badge {
    background: var(--danger-color);
    color: var(--white-color);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* فوتر */
.footer {
    background: var(--dark-color);
    color: var(--white-color);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: 20px;
    color: var(--white-color);
}

.footer-col p {
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin: 12px 0;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--white-color);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* دکمه اسکرول */
.scroll-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 999;
}

.scroll-top:hover {
    transform: translateY(-5px);
}

.scroll-top.visible {
    display: flex;
}

/* مودال‌ها */
.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: 2000;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white-color);
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    font-size: 24px;
    color: var(--dark-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--danger-color);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* بارگذاری */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* رسپانسیو */
@media (max-width: 1200px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        order: -1;
    }
}

@media (max-width: 992px) {
    .admin-panel,
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar,
    .profile-sidebar {
        position: relative;
        top: 0;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-box-advanced {
        grid-template-columns: 1fr;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* انیمیشن‌ها */
.fade-in {
    animation: fadeIn 0.5s;
}

.slide-in {
    animation: slideIn 0.5s;
}

@keyframes slideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}