/* ============================================
   EZHARAJ - إزي حراج
   Main Stylesheet
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    direction: rtl;
    padding-bottom: 70px;
}

/* ===== Top Bar ===== */
.top-bar {
    background: #1877f2;
    color: white;
    padding: 6px 15px;
    overflow: hidden;
    font-size: 12px;
    position: relative;
    height: 50px;
}

.top-right-btns {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

.btn-dark-top {
    background: transparent;
    color: white;
    border: 1px solid white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    line-height: 26px;
}

.btn-lang-top {
    background: white;
    color: #1877f2;
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
}

.btn-login-top {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: #1877f2;
    border: none;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
}

.center-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.welcome-text { display: block; }

.site-url {
    display: block;
    font-size: 11px;
    color: #fff;
    opacity: 0.9;
    margin-top: 2px;
}

/* ===== Header ===== */
header {
    background: #1877f2;
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    white-space: nowrap;
}

.logo .ezi { color: #ff9800; }
.logo .haraj { color: white; }

.search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 25px;
    border: none;
    font-size: 14px;
    background: white;
    color: #333;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-search {
    background: white;
    color: #1877f2;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    line-height: 36px;
}

.btn-search-lang {
    background: #ff9800;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
}

/* ===== Country Filter ===== */
.country-filter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 10px;
    white-space: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    display: block;
}

.country-filter button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin: 3px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.country-filter button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.country-filter button.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.country-flag { font-size: 18px; }

/* ===== City Filter ===== */
.city-filter {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 12px 10px;
    white-space: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    display: none;
}

.city-filter.show { display: block; }

.city-filter button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    margin: 3px;
    border: 2px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.city-filter button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102,126,234,0.3);
}

.city-filter button.active {
    background: #667eea;
    color: white;
    box-shadow: 0 3px 10px rgba(102,126,234,0.4);
    transform: translateY(-2px);
}

.city-icon { font-size: 14px; }

/* ===== Category Tabs ===== */
.cats {
    background: white;
    padding: 12px;
    white-space: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    display: block;
}

.cats.hidden { display: none; }

.cats button {
    display: inline-block;
    padding: 8px 18px;
    margin: 3px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.cats button.active {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

/* ===== Sub Categories ===== */
.sub-cats {
    background: #f8f9fa;
    padding: 10px;
    white-space: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #ddd;
    display: none;
}

.sub-cats.show { display: block; }

.sub-cats button {
    display: inline-block;
    padding: 6px 14px;
    margin: 3px;
    border: 1px solid #ccc;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    font-size: 13px;
}

.sub-cats button:hover {
    background: #1877f2;
    color: white;
}

/* ===== Hero Banner ===== */
.banner {
    background: #1877f2;
    color: white;
    text-align: center;
    padding: 35px 20px;
}

.banner h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.banner p {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.btn-green {
    background: #28a745;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

/* ===== Filter Section ===== */
.filter-box {
    background: white;
    padding: 20px;
    margin: 15px;
    border-radius: 12px;
    text-align: center;
}

.filter-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.filter-box p {
    color: #888;
    margin-bottom: 15px;
    font-size: 14px;
}

.filter-btns button {
    padding: 8px 20px;
    margin: 5px;
    border: 1px solid #1877f2;
    border-radius: 20px;
    background: white;
    color: #1877f2;
    cursor: pointer;
}

/* ===== Items ===== */
.items-box { padding: 15px; }

.item-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-img {
    width: 100%;
    height: 200px;
    background: #eee;
    position: relative;
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff9800;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.item-info {
    padding: 15px;
    text-align: right;
}

.item-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.item-price {
    color: #1877f2;
    font-size: 18px;
    font-weight: bold;
}

.item-meta {
    color: #888;
    font-size: 13px;
    margin-top: 5px;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
}

.nav-item {
    text-align: center;
    color: #888;
    font-size: 12px;
    cursor: pointer;
}

.nav-item.active { color: #1877f2; }

.nav-icon {
    font-size: 24px;
    margin-bottom: 3px;
}

/* ===== Add Button Float ===== */
.add-float {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 55px;
    height: 55px;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 55px;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 200;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Login Page ===== */
.login-box {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    color: #1877f2;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-register {
    width: 100%;
    padding: 14px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.links a {
    color: #1877f2;
    text-decoration: none;
}

.back-btn {
    text-align: center;
    margin-top: 15px;
}

.back-btn a {
    color: #888;
    text-decoration: none;
}

/* ===== Register Page ===== */
.register-box {
    max-width: 450px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.register-box h2 {
    text-align: center;
    color: #28a745;
    margin-bottom: 20px;
}

.disclaimer-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.disclaimer-box h3 {
    color: #856404;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

.disclaimer-box p, .disclaimer-box li {
    color: #856404;
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.disclaimer-box ul { padding-right: 20px; }

.disclaimer-box .warning {
    color: #dc3545;
    font-weight: bold;
}

.checkbox-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 8px;
}

.checkbox-agree input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.checkbox-agree label {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

/* ===== Add Item Page ===== */
.add-top-bar {
    background: #1877f2;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    position: relative;
}

.add-back-btn {
    position: absolute;
    left: 15px;
    top: 15px;
    background: white;
    color: #1877f2;
    border: none;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    font-weight: bold;
}

.form-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 0 15px;
}

.form-container .form-group {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-container .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.form-container .form-group input,
.form-container .form-group select,
.form-container .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    transition: border-color 0.3s;
}

.form-container .form-group input:focus,
.form-container .form-group select:focus,
.form-container .form-group textarea:focus {
    outline: none;
    border-color: #1877f2;
}

.form-container .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.price-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-input-wrapper input { flex: 1; }

.currency-badge {
    background: #1877f2;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.select-wrapper { position: relative; }

.select-wrapper select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.category-grid button {
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s;
}

.category-grid button:hover {
    border-color: #1877f2;
    background: #e3f2fd;
}

.category-grid button.selected {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.category-grid button .cat-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 5px;
}

.sub-fields { display: none; }
.sub-fields.show { display: block; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.image-upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.image-upload-area:hover {
    border-color: #1877f2;
    background: #e3f2fd;
}

.upload-icon { font-size: 48px; margin-bottom: 10px; }
.upload-text { color: #666; font-size: 14px; }
.upload-hint { color: #888; font-size: 12px; margin-top: 5px; }

.image-preview-box {
    margin-top: 15px;
    display: none;
}

.image-preview-box.show { display: block; }

.preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.btn-remove-img {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
    transition: all 0.3s;
}

.btn-submit:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40,167,69,0.4);
}

.btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* ===== Dark Mode ===== */
.dark-mode body {
    background: #1a1a1a;
    color: #fff;
}

.dark-mode .top-bar,
.dark-mode header,
.dark-mode .banner,
.dark-mode .add-top-bar { background: #1565c0; }

.dark-mode .search-box input {
    background: #2d2d2d;
    color: #fff;
}

.dark-mode .btn-search {
    background: #2d2d2d;
    color: #42a5f5;
}

.dark-mode .btn-search-lang { background: #e65100; color: #fff; }
.dark-mode .btn-lang-top { background: #2d2d2d; color: #42a5f5; }
.dark-mode .btn-login-top { background: #2d2d2d; color: #42a5f5; }

.dark-mode .country-filter {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .country-filter button {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #ccc;
}

.dark-mode .country-filter button:hover { background: rgba(255,255,255,0.2); }

.dark-mode .country-filter button.active {
    background: #42a5f5;
    color: white;
    border-color: #42a5f5;
}

.dark-mode .city-filter {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
}

.dark-mode .city-filter button {
    background: #2d2d2d;
    color: #42a5f5;
    border-color: #42a5f5;
}

.dark-mode .city-filter button:hover {
    background: #42a5f5;
    color: white;
}

.dark-mode .city-filter button.active {
    background: #42a5f5;
    color: white;
}

.dark-mode .cats,
.dark-mode .filter-box,
.dark-mode .item-card,
.dark-mode .bottom-nav,
.dark-mode .login-box,
.dark-mode .register-box,
.dark-mode .form-container .form-group {
    background: #2d2d2d;
    color: #fff;
}

.dark-mode .cats button {
    background: #3d3d3d;
    color: #fff;
    border-color: #555;
}

.dark-mode .cats button.active {
    background: #1877f2;
    color: white;
}

.dark-mode .sub-cats { background: #1a1a1a; }

.dark-mode .sub-cats button {
    background: #3d3d3d;
    color: #fff;
    border-color: #555;
}

.dark-mode .sub-cats button:hover {
    background: #1877f2;
    color: white;
}

.dark-mode .item-info { color: #fff; }
.dark-mode .item-title { color: #fff; }
.dark-mode .item-price { color: #42a5f5; }
.dark-mode .item-meta { color: #aaa; }
.dark-mode .nav-item { color: #888; }
.dark-mode .nav-item.active { color: #42a5f5; }
.dark-mode .filter-box h3 { color: #fff; }
.dark-mode .filter-box p { color: #aaa; }

.dark-mode .filter-btns button {
    background: #3d3d3d;
    color: #42a5f5;
    border-color: #42a5f5;
}

.dark-mode .fav-btn { background: #3d3d3d; }

.dark-mode .form-group label { color: #aaa; }

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: #3d3d3d;
    color: #fff;
    border-color: #555;
}

.dark-mode .links a,
.dark-mode .back-btn a { color: #42a5f5; }

.dark-mode .disclaimer-box {
    background: #3d3d3d;
    border-color: #ff9800;
}

.dark-mode .disclaimer-box h3,
.dark-mode .disclaimer-box p,
.dark-mode .disclaimer-box li { color: #ffcc80; }

.dark-mode .checkbox-agree { background: #1b5e20; }
.dark-mode .checkbox-agree label { color: #fff; }

.dark-mode .category-grid button {
    background: #2d2d2d;
    color: #fff;
    border-color: #555;
}

.dark-mode .category-grid button:hover {
    border-color: #42a5f5;
    background: #1a1a2e;
}

.dark-mode .category-grid button.selected {
    background: #42a5f5;
    border-color: #42a5f5;
}

.dark-mode .image-upload-area {
    background: #2d2d2d;
    border-color: #555;
}

.dark-mode .image-upload-area:hover {
    border-color: #42a5f5;
    background: #1a1a2e;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .logo { font-size: 18px; }
    .banner h1 { font-size: 22px; }
    .banner p { font-size: 14px; }
    .btn-green {
        padding: 12px 24px;
        font-size: 14px;
    }
}