/* ========================================
   حراج برو - التصميم الرئيسي
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #00a859;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    background: #f5f5f5;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid #eee;
}

.search-box:focus-within {
    border-color: #00a859;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.search-box button {
    padding: 12px 20px;
    background: #00a859;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.search-box button:hover {
    background: #008f4a;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.header-actions a:hover {
    background: #f0f0f0;
    color: #00a859;
}

.btn-add-ad {
    background: #ff6b00 !important;
    color: white !important;
    font-weight: 600;
}

.btn-add-ad:hover {
    background: #e55f00 !important;
}

/* Categories Bar */
.categories-bar {
    background: #00a859;
    overflow-x: auto;
}

.categories-list {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    white-space: nowrap;
}

.categories-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    color: white;
    font-size: 13px;
    transition: background 0.2s;
}

.categories-list a:hover,
.categories-list a.active {
    background: rgba(255,255,255,0.15);
}

/* ========================================
   Container
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

main.container {
    min-height: calc(100vh - 300px);
}

/* ========================================
   Home Hero
   ======================================== */
.home-hero {
    background: linear-gradient(135deg, #00a859, #007a40);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.home-hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.home-hero p {
    font-size: 16px;
    opacity: 0.9;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-item .number {
    font-size: 36px;
    font-weight: bold;
}

.stat-item .label {
    font-size: 14px;
    opacity: 0.8;
}

/* ========================================
   Cities Filter
   ======================================== */
.cities-filter {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cities-filter h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.cities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cities-list a {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.cities-list a:hover,
.cities-list a.active {
    background: #00a859;
    color: white;
}

/* ========================================
   Section Title
   ======================================== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.section-title h2 {
    font-size: 20px;
    color: #333;
}

.section-title span {
    font-size: 13px;
    color: #888;
}

/* ========================================
   Ads Grid
   ======================================== */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ========================================
   Ad Card
   ======================================== */
.ad-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.ad-card-image {
    position: relative;
    height: 200px;
    background: #f5f5f5;
    overflow: hidden;
}

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

.ad-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.badge-featured {
    background: #ffc107;
    color: #333;
}

.badge-urgent {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.ad-card-body {
    padding: 15px;
}

.ad-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
}

.ad-card-title a {
    color: #333;
}

.ad-card-title a:hover {
    color: #00a859;
}

.ad-card-price {
    font-size: 18px;
    font-weight: bold;
    color: #00a859;
    margin-bottom: 10px;
}

.ad-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #888;
    margin-bottom: 20px;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
}

.pagination a:hover {
    background: #00a859;
    color: white;
}

.pagination a.active {
    background: #00a859;
    color: white;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #00a859;
    color: white;
}

.btn-primary:hover {
    background: #008f4a;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    border-color: #00a859;
    color: #00a859;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-call {
    background: #00a859;
    color: white;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #00a859;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ========================================
   Form Page
   ======================================== */
.form-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.form-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.form-card h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.form-card .subtitle {
    color: #888;
    margin-bottom: 30px;
}

/* Image Upload */
.image-upload {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.image-upload:hover {
    border-color: #00a859;
    background: #f8fff9;
}

.image-upload .icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

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

.image-preview .remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

/* ========================================
   Ad Page
   ======================================== */
.ad-page {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.ad-main {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* Gallery */
.ad-gallery {
    background: #000;
}

.ad-gallery-main {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ad-gallery-thumbs {
    display: flex;
    gap: 5px;
    padding: 10px;
    overflow-x: auto;
    background: #111;
}

.ad-gallery-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ad-gallery-thumbs img:hover,
.ad-gallery-thumbs img.active {
    opacity: 1;
}

/* Ad Content */
.ad-content {
    padding: 30px;
}

.ad-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
}

.ad-price-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ad-price {
    font-size: 28px;
    font-weight: bold;
    color: #00a859;
}

.ad-price-type {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
}

.ad-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.ad-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.ad-meta-item .icon {
    font-size: 18px;
}

.ad-description {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
}

/* Ad Specs */
.ad-specs {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.ad-specs h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.specs-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.spec-item .label {
    color: #888;
}

.spec-item .value {
    font-weight: 600;
    color: #333;
}

/* Ad Sidebar */
.ad-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Seller Card */
.seller-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.seller-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    overflow: hidden;
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.seller-info .verified {
    font-size: 12px;
    color: #00a859;
}

.seller-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #888;
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Safety Card */
.safety-card {
    background: #fff8e1;
    border-radius: 15px;
    padding: 20px;
}

.safety-card h4 {
    font-size: 15px;
    margin-bottom: 15px;
    color: #333;
}

.safety-card ul {
    font-size: 13px;
    color: #666;
}

.safety-card li {
    padding: 5px 0;
    padding-right: 20px;
    position: relative;
}

.safety-card li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: #ffc107;
}

/* ========================================
   Category Page
   ======================================== */
.category-page {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.filters-sidebar {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 150px;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section h4 {
    font-size: 15px;
    margin-bottom: 15px;
    color: #333;
}

.price-range {
    display: flex;
    gap: 10px;
}

.price-range input {
    flex: 1;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 13px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
}

.category-content {
    min-width: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-header h1 {
    font-size: 22px;
}

.sort-select {
    padding: 10px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.subcategories a {
    padding: 10px 20px;
    background: white;
    border-radius: 25px;
    font-size: 13px;
    color: #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.subcategories a:hover {
    background: #00a859;
    color: white;
}

.subcategories a small {
    color: #888;
    margin-right: 5px;
}

.mobile-filters-btn {
    display: none;
    margin-bottom: 20px;
}

/* ========================================
   Account Page
   ======================================== */
.account-page {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.account-sidebar {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    height: fit-content;
}

.account-user {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.account-user .avatar {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.account-user h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.account-user small {
    color: #888;
}

.account-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    color: #555;
    transition: all 0.2s;
}

.account-nav a:hover,
.account-nav a.active {
    background: #e8f5e9;
    color: #00a859;
}

.account-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.account-header h1 {
    font-size: 22px;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #00a859;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: #1a1a2e;
    color: white;
    margin-top: 50px;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-col h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #00a859;
}

.footer-col p {
    color: #999;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a,
.footer-col li {
    color: #999;
    font-size: 14px;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    font-size: 13px;
    color: #999;
}

/* ========================================
   Utilities
   ======================================== */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.text-muted { color: #888; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.gap-1 { gap: 10px; }

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .header-top {
        flex-wrap: wrap;
    }
    
    .search-box {
        order: 3;
        flex: 1 0 100%;
        max-width: none;
        margin-top: 15px;
    }
    
    .header-actions span {
        display: none;
    }
    
    .ad-page {
        grid-template-columns: 1fr;
    }
    
    .ad-sidebar {
        order: -1;
    }
    
    .category-page {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        z-index: 1001;
        border-radius: 0;
        overflow-y: auto;
    }
    
    .filters-sidebar.show {
        display: block;
    }
    
    .mobile-filters-btn {
        display: flex;
    }
    
    .account-page {
        grid-template-columns: 1fr;
    }
    
    .account-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .account-user {
        flex: 1 0 100%;
        padding-bottom: 15px;
        margin-bottom: 0;
    }
    
    .account-nav {
        flex: 1 0 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .account-nav a {
        flex: 1;
        justify-content: center;
        padding: 10px;
    }
    
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-row {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .stat-item {
        flex: 1 0 30%;
    }
    
    .stat-item .number {
        font-size: 28px;
    }
    
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ad-card-image {
        height: 150px;
    }
    
    .ad-gallery-main {
        height: 300px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-card {
        padding: 25px;
    }
    
    .specs-table {
        grid-template-columns: 1fr;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .home-hero {
        padding: 30px 20px;
    }
    
    .home-hero h1 {
        font-size: 24px;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-card-image {
        height: 200px;
    }
    
    .categories-list a {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .btn-add-ad span {
        display: none;
    }
}
