:root {
    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Roboto Condensed", "Arial Narrow", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: #f7f4ef;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.48)),
        url("../assets/marble.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    color: #333333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: #b03a74;
}

a:hover {
    color: #8a2c5a;
}

/* Header & Navigation */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    padding: 15px 0 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.logo-container {
    margin-bottom: 10px;
}

.logo-container img {
    max-width: 280px;
    height: auto;
}

nav {
    border-top: 1px solid #eeeeee;
    display: flex;
    justify-content: center;
    background-color: #ffffff;
}

nav ul {
    list-style: none;
    display: flex;
    width: 100%;
    max-width: 800px;
}

nav li {
    flex: 1;
    text-align: center;
    border-right: 1px solid #eeeeee;
}

nav li:last-child {
    border-right: none;
}

nav a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    color: #444444;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

nav a:hover,
nav a.active {
    background-color: #fafafa;
    color: #b03a74;
    font-weight: 700;
}

/* Main */
main {
    flex: 1;
    max-width: 730px;
    width: 90%;
    margin: 30px auto 40px auto;
}

main.wide {
    max-width: 960px;
}

.hero-banner {
    width: 100%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.hero-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.content-box {
    padding: 10px 15px;
    text-align: left;
    line-height: 1.7;
    font-size: 16px;
}

.content-box h1,
main > h1,
.page-title {
    font-size: 34px;
    font-weight: 600;
    color: #222222;
    margin-bottom: 18px;
    text-align: left;
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.content-box p,
main > p {
    margin: 0 0 14px;
    color: #2b2b2b;
}

.content-box a.inline-link,
main > p a.inline-link {
    color: #2b2b2b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.content-box a.inline-link:hover,
main > p a.inline-link:hover {
    color: #b03a74;
}

.payment-info {
    margin-top: 20px;
    font-size: 15px;
    color: #333;
}

/* Heart divider */
.heart-divider {
    text-align: center;
    margin: 20px 0 -35px 0;
    position: relative;
    z-index: 10;
}

.heart-divider img {
    width: 140px;
    height: auto;
}

/* Footer */
footer {
    background: linear-gradient(180deg, #181938 0%, #101127 100%);
    color: #e0e0e0;
    text-align: center;
    padding: 45px 15px 25px 15px;
    font-family: var(--font-body);
    font-size: 14px;
    margin-top: auto;
    border-top: 2px solid #2a2c54;
    position: relative;
}

footer p {
    margin: 6px 0;
    opacity: 0.9;
}

footer a {
    color: #f0d7e4;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.email-protect {
    cursor: pointer;
}

.legal-content .email-protect {
    color: #b03a74;
}

footer .footer-links {
    margin-top: 10px;
    font-size: 13px;
}

footer .footer-links a {
    margin: 0 8px;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 40;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #f7f0f3;
    background: #b03a74;
    box-shadow: 0 6px 18px rgba(40, 18, 34, 0.28);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.15s ease;
}

.back-to-top[hidden] {
    display: none !important;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: #8a2c5a;
    outline: none;
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Alerts & forms */
.alert {
    font-family: var(--font-body);
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 1px solid #ddd;
    background: #fff;
}

.alert-success {
    border-color: #b7d7b0;
    background: #f3faf1;
    color: #2f5d2a;
}

.alert-error {
    border-color: #e0b4b4;
    background: #fdf4f4;
    color: #8a2c2c;
}

.alert-info {
    border-color: #c9c9d6;
    background: #f7f7fb;
    color: #333;
}

.panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #e6e2da;
    padding: 22px;
    margin-bottom: 22px;
}

.panel h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 14px;
    font-family: var(--font-display);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.ad-form .form-row-name {
    margin-top: 18px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 14px;
}

.form-row label {
    color: #333;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="tel"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 15px;
    font-family: var(--font-body);
    color: #222;
}

.password-field {
    position: relative;
    display: block;
    width: 100%;
}

.password-field input {
    width: 100%;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    color: #666;
    line-height: 0;
    border-radius: 4px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #b03a74;
    outline: none;
}

.password-toggle svg {
    width: 22px;
    height: 22px;
    display: block;
}

.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

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

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 14px;
}

.btn {
    display: inline-block;
    border: 1px solid #b03a74;
    background: #b03a74;
    color: #fff;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 14px;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: #8a2c5a;
    border-color: #8a2c5a;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #b03a74;
}

.btn-secondary:hover {
    background: #faf0f5;
    color: #8a2c5a;
}

.btn-danger {
    background: #7a2e2e;
    border-color: #7a2e2e;
}

.btn-danger:hover {
    background: #5e2222;
    border-color: #5e2222;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 24px;
    font-family: var(--font-body);
}

.search-form .form-row {
    margin: 0;
}

/* Ad cards */
.ads-list {
    display: grid;
    gap: 18px;
}

.ad-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid #e6e2da;
    padding: 16px;
    text-align: left;
}

.ad-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.ad-photo-trigger {
    position: relative;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: zoom-in;
    display: block;
    width: 100%;
}

.ad-photo-trigger img {
    pointer-events: none;
}

.ad-photo-count {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(24, 25, 56, 0.82);
    color: #fff;
    font-size: 12px;
    font-family: var(--font-body);
    padding: 3px 7px;
}

.ad-photo-empty {
    width: 100%;
    height: 160px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    color: #777;
    font-size: 14px;
}

.form-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.image-sorter {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.image-sort-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px;
}

.image-sort-item:focus {
    outline: 2px solid #b03a74;
}

.image-sort-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-sort-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.image-sort-actions .btn {
    padding: 6px 10px;
    min-width: 36px;
}

.img-remove-label {
    font-family: var(--font-body);
    font-size: 14px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

/* Lightbox */
.lightbox[hidden] {
    display: none !important;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.lightbox-dialog {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    pointer-events: none;
}

.lightbox-image {
    max-width: min(96vw, 1100px);
    max-height: 85vh;
    object-fit: contain;
    pointer-events: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
    background: #111;
}

.lightbox-close,
.lightbox-nav {
    pointer-events: auto;
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 4px;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-close {
    top: 16px;
    right: 16px;
    font-size: 32px;
}

.lightbox-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    pointer-events: none;
}

.ad-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.ad-meta {
    font-family: var(--font-body);
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.ad-message {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.ad-phone {
    font-family: var(--font-body);
    font-size: 15px;
}

.ad-phone a {
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

.ad-phone a:hover {
    color: #b03a74;
}

.empty-state {
    font-family: var(--font-body);
    padding: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #e6e2da;
    text-align: center;
}

.preview-thumb {
    max-width: 160px;
    margin-top: 8px;
}

.legal-content {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
}

.legal-content h2 {
    font-size: 18px;
    margin: 22px 0 10px;
    font-family: var(--font-display);
    font-weight: normal;
}

.legal-content ul {
    margin: 10px 0 10px 22px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    margin: 0 0 18px;
    border: none;
    border-bottom: 1px solid #d8d2c8;
    background: transparent;
    box-shadow: none;
    font-family: var(--font-body);
    text-align: left;
}

.admin-tabs a {
    display: inline-block;
    flex: 0 0 auto;
    padding: 10px 18px;
    text-decoration: none;
    color: #555;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    background: transparent;
}

.admin-tabs a:hover {
    color: #b03a74;
    background: transparent;
    font-weight: 400;
}

.admin-tabs a.active {
    color: #b03a74;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    border-color: #d8d2c8;
    border-bottom-color: #fff;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 14px;
    background: #fff;
}

table.admin-table th,
table.admin-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

table.admin-table th {
    background: #f5f5f5;
}

table.admin-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

@media (max-width: 700px) {
    body {
        background-attachment: scroll;
    }

    .content-box h1,
    main > h1,
    .page-title {
        font-size: 26px;
    }

    nav a {
        font-size: 13px;
        padding: 10px 0;
    }

    .auth-tabs,
    .search-form,
    .ad-card {
        grid-template-columns: 1fr;
    }

    .ad-card img {
        height: 220px;
    }

    .back-to-top {
        right: 14px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}
