/* =========================================================
   1. Base & Reset
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #edf2fb;
    color: #0d1530;
}

a {
    color: #1a4fd8;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* =========================================================
   2. Layout
   ========================================================= */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container--wide {
    max-width: 860px;
}

/* =========================================================
   3. Navigation
   ========================================================= */
.navbar {
    background: linear-gradient(to right, #001e72, #0038c8);
    color: #fff;
    padding: 0.75rem 0;
    position: relative;
    border-bottom: 3px solid #0055ff;
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar__brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Hamburger button */
.navbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #99bef5;
    border-radius: 2px;
    transition: background 0.2s;
}

.navbar__toggle:hover span { background: #fff; }

/* Desktop nav links */
.navbar__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.navbar__links a {
    color: #99bef5;
    font-size: 0.9rem;
}
.navbar__links a:hover {
    color: #fff;
    text-decoration: none;
}

.navbar__logout {
    margin: 0;
    padding: 0;
    display: inline;
}

/* Mobile: hamburger active */
@media (max-width: 600px) {
    .navbar__toggle {
        display: flex;
    }

    .navbar__links {
        display: none;
        opacity: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #001e72;
        padding: 0.75rem 1.25rem 1rem;
        z-index: 100;
        transition: opacity 0.2s ease;
    }

    .navbar__links.navbar__links--open {
        display: flex;
        opacity: 1;
    }

    .navbar__links a,
    .navbar__links .btn--link {
        padding: 0.5rem 0;
        width: 100%;
        border-bottom: 1px solid #0038a0;
    }

    .navbar__logout {
        width: 100%;
    }
}


/* =========================================================
   4. Card
   ========================================================= */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(0, 40, 140, 0.10);
    padding: 2rem;
    margin-top: 2rem;
    border-top: 3px solid #1a4fd8;
}

.card__title {
    margin: 0 0 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #001e72;
}

/* =========================================================
   5. Forms
   ========================================================= */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #0d1530;
}

.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=tel],
.form-group input[type=number],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #b8caf0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    color: #0d1530;
    background: #fafcff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a4fd8;
    box-shadow: 0 0 0 3px rgba(26, 79, 216, 0.18);
    background: #fff;
}

/* =========================================================
   6. Buttons
   ========================================================= */
.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.btn--primary {
    background: #1a4fd8;
    color: #fff;
}
.btn--primary:hover {
    background: #1340bb;
    text-decoration: none;
    color: #fff;
}

.btn--secondary {
    background: #dce8ff;
    color: #0d1530;
}
.btn--secondary:hover {
    background: #c4d8f8;
    text-decoration: none;
}

.btn--link {
    background: none;
    color: #99bef5;
    padding: 0;
    font-size: 0.9rem;
}
.btn--link:hover {
    color: #fff;
    text-decoration: none;
}

/* =========================================================
   7. Flash Messages
   ========================================================= */
.flash {
    padding: 0.85rem 1.1rem;
    border-radius: 6px;
    margin-top: 1.25rem;
    font-size: 0.95rem;
}

.flash--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash--info {
    background: #d6e4ff;
    color: #001e72;
    border: 1px solid #b3ccff;
}

/* =========================================================
   8. Avatar
   ========================================================= */
.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #b3ccff;
}

.avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001e72, #1a4fd8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid #b3ccff;
    flex-shrink: 0;
}

.avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* =========================================================
   9. Drop Zone
   ========================================================= */
.drop-zone {
    border: 2px dashed #1a4fd8;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    color: #555;
}

.drop-zone:hover {
    background: #f0f5ff;
}

.drop-zone.drag-over {
    background: #e4edff;
}

.drop-zone input[type=file] {
    display: none;
}

.drop-zone .drop-label {
    font-size: 0.95rem;
    color: #1a4fd8;
}

/* =========================================================
   10. Utility
   ========================================================= */
.text-muted {
    color: #6677aa;
}

.text-sm {
    font-size: 0.875rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.site-footer {
    text-align: center;
    padding: 2rem 0 1.5rem;
    border-top: 1px solid #ccd9f5;
    margin-top: 2rem;
}

/* =========================================================
   11. Show-password toggle
   ========================================================= */
.pw-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pw-wrap input[type=password],
.pw-wrap input[type=text] {
    flex: 1;
    padding-right: 2.75rem;
}

.pw-toggle {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 0;
    transition: color 0.15s;
}

.pw-toggle:hover { color: #1a4fd8; }

/* =========================================================
   12. Password Strength Bar
   ========================================================= */
.strength-bar {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    height: 6px;
}

.strength-bar__seg {
    flex: 1;
    border-radius: 3px;
    background: #e0e0e0;
    transition: background 0.25s;
}

.strength-label {
    font-size: 0.78rem;
    margin-top: 4px;
    color: #888;
    min-height: 1.1em;
}

/* =========================================================
   13. Error Lists
   ========================================================= */
.error-list {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0;
}

.error-list li {
    font-size: 0.85rem;
    color: #c0392b;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-welcome__info h2 {
    margin: 0 0 0.25rem;
}

.dashboard-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================================
   14. Verified Badge
   ========================================================= */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    vertical-align: middle;
}

/* =========================================================
   15. Classifieds
   ========================================================= */

/* Category tabs */
.cat-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
}

.cat-tab {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.875rem;
    border: 1px solid #b8caf0;
    color: #1a4fd8;
    text-decoration: none;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}

.cat-tab:hover,
.cat-tab--active {
    background: #1a4fd8;
    color: #fff;
    border-color: #1a4fd8;
    text-decoration: none;
}

/* Advert card grid */
.advert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.advert-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 40, 140, 0.09);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.advert-card:hover {
    box-shadow: 0 4px 20px rgba(0, 40, 140, 0.18);
    text-decoration: none;
}

.advert-card__img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #edf2fb;
}

.advert-card__no-img {
    width: 100%;
    height: 180px;
    background: #edf2fb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aab;
    font-size: 2.5rem;
}

.advert-card__body {
    padding: 0.9rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.advert-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #001e72;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.advert-card__meta {
    font-size: 0.8rem;
    color: #6677aa;
    margin: 0;
}

.advert-card__price {
    margin-top: auto;
    padding-top: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: #0d1530;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge--active    { background: #d4edda; color: #155724; }
.badge--expired   { background: #fff3cd; color: #856404; }
.badge--suspended { background: #f8d7da; color: #721c24; }
.badge--deleted   { background: #e9ecef; color: #6c757d; }
.badge--cat       { background: #dce8ff; color: #001e72; }

/* Image gallery */
.advert-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.advert-gallery a img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dce8ff;
    display: block;
    transition: opacity 0.15s;
}

.advert-gallery a:hover img { opacity: 0.85; }

/* Upload thumbs */
.advert-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.advert-thumb {
    position: relative;
    width: 100px;
    height: 100px;
}

.advert-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #b8caf0;
}

.advert-thumb__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Photo thumb action menu (... button) */
.advert-edit-img {
    position: relative;
}

.thumb-menu {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
}

.thumb-menu__btn {
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.thumb-menu__btn:hover { background: rgba(0,0,0,0.8); }

.thumb-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    background: #fff;
    border: 1px solid #dce8ff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 130px;
    overflow: hidden;
}

.thumb-menu--open .thumb-menu__dropdown { display: block; }

.thumb-menu__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #0d1530;
    white-space: nowrap;
}

.thumb-menu__item:hover { background: #f0f5ff; }
.thumb-menu__item--danger { color: #c0392b; }
.thumb-menu__item--danger:hover { background: #fff5f5; }

.thumb-primary-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #16a34a;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

.drop-zone--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Advert detail page */
.advert-detail__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #001e72;
    margin: 0.25rem 0 0.75rem;
}

.advert-meta-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.advert-meta-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid #edf2fb;
    font-size: 0.9rem;
}

.advert-meta-list li:last-child { border-bottom: none; }

/* My adverts table */
.advert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.advert-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #dce8ff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6677aa;
}

.advert-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #edf2fb;
    vertical-align: middle;
}

.advert-table tr:last-child td { border-bottom: none; }

/* Report modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.modal--open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-box h3 { margin-top: 0; }


.btn--danger {
    background: #c0392b;
    color: #fff;
}

.btn--danger:hover {
    background: #a93226;
    color: #fff;
    text-decoration: none;
}

/* Lightbox */
.lightbox__img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox__close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: rgba(0,0,0,0.55);
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 201;
}

.lightbox__close:hover { background: rgba(0,0,0,0.8); }

/* Make gallery thumbnails show pointer */
.advert-gallery .lightbox-trigger { cursor: zoom-in; }
