@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&display=swap');

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo span {
    color: #ffd700;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-menu .btn-register {
    background: #ffd700;
    color: #333;
}

.nav-menu .btn-register:hover {
    background: #ffed4a;
    transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-section h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.hero-section p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.search-box input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-family: 'Vazirmatn', sans-serif;
    outline: none;
}

.search-box button {
    padding: 15px 35px;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
}

.search-box button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    padding: 60px 0;
}

.categories-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 900;
    color: #333;
    margin-bottom: 40px;
    position: relative;
}

.categories-section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 10px auto 0;
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    background: white;
    padding: 40px 20px;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card .icon {
    font-size: 60px;
    margin-bottom: 15px;
    display: block;
}

.category-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.category-card p {
    color: #666;
    font-size: 14px;
}

.category-card .ad-count {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

.category-card.humans::before {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.category-card.objects::before {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.category-card.animals::before {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

/* ===== ADS GRID ===== */
.latest-ads {
    padding: 60px 0;
}

.latest-ads h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 900;
    color: #333;
    margin-bottom: 40px;
    position: relative;
}

.latest-ads h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 10px auto 0;
    border-radius: 2px;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.ad-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.ad-image {
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 48px;
    color: #ccc;
}

.category-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    backdrop-filter: blur(5px);
}

.ad-info {
    padding: 20px;
}

.ad-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.location, .phone {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.location span, .phone span {
    display: inline-block;
}

.ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.date {
    color: #999;
    font-size: 12px;
}

.view-btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
}

.pagination button {
    padding: 10px 20px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
}

.pagination button:hover {
    background: #667eea;
    color: white;
}

.pagination .page-info {
    font-weight: 500;
    color: #333;
}

/* ===== NO ADS ===== */
.no-ads {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    grid-column: 1 / -1;
}

.no-ads p {
    font-size: 20px;
    color: #666;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* ===== STATS SECTION ===== */
.stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    margin-top: 50px;
}

.stats-section .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    color: white;
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 18px;
    opacity: 0.9;
}

/* ===== FOOTER ===== */
.footer {
    background: #2d3436;
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.footer a {
    color: #dfe6e9;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.footer a:hover {
    color: #667eea;
    padding-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #404040;
    color: #b2bec3;
}

/* ===== ADMIN PANEL ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-nav {
    width: 250px;
    background: #2d3436;
    color: white;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-nav h2 {
    font-size: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
}

.admin-nav ul li {
    margin-bottom: 10px;
}

.admin-nav ul li a {
    color: #dfe6e9;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.3s;
}

.admin-nav ul li a:hover {
    background: rgba(255,255,255,0.1);
}

.admin-content {
    margin-right: 250px;
    padding: 30px;
    flex: 1;
}

.admin-content h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
}

/* Admin Stats */
.stats-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card h3 {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 14px;
}

/* Admin Table */
.admin-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: right;
    font-weight: 700;
    color: #333;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.status-pending {
    color: #f39c12;
    font-weight: 500;
}

.status-approved {
    color: #27ae60;
    font-weight: 500;
}

.status-rejected {
    color: #e74c3c;
    font-weight: 500;
}

.btn-approve {
    padding: 5px 15px;
    background: #27ae60;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    margin: 0 5px;
}

.btn-reject {
    padding: 5px 15px;
    background: #e74c3c;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    margin: 0 5px;
}

/* ===== LOGIN PAGES ===== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h2 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
}

.login-box input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s;
}

.login-box input:focus {
    border-color: #667eea;
    outline: none;
}

.login-box button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.error-message {
    background: #fee;
    color: #e74c3c;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.success-msg {
    background: #efe;
    color: #27ae60;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* ===== NEW AD FORM ===== */
.new-ad-form {
    max-width: 700px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.05);
}

.new-ad-form h2 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.new-ad-form button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
}

.new-ad-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* ===== PAYMENT PAGE ===== */
.payment-box {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.05);
    text-align: center;
}

.payment-box h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.payment-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.payment-details p {
    font-size: 18px;
    color: #333;
}

.payment-details strong {
    color: #667eea;
    font-size: 24px;
}

.pay-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Vazirmatn', sans-serif;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 32px;
    }
    
    .hero-section p {
        font-size: 16px;
    }
    
    .search-box {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: 10px;
    }
    
    .search-box input {
        border-radius: 50px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .search-box button {
        border-radius: 50px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 15px;
    }
    
    .nav-menu a {
        display: block;
        text-align: center;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-nav {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px;
    }
    
    .admin-content {
        margin-right: 0;
        padding: 15px;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
    
    .new-ad-form {
        padding: 20px;
        margin: 20px;
    }
    
    .login-container {
        padding: 10px;
    }
    
    .login-box {
        padding: 20px;
    }
    
    .stats-section .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 24px;
    }
    
    .category-card .icon {
        font-size: 40px;
    }
    
    .stat-number {
        font-size: 32px;
    }
}