/* ==========================================================================
   Rehla Jordania (رحلة أردنية) - Main Design System & Stylesheet
   ========================================================================== */

:root {
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

    /* Authentic Jordan Tourism Color Tokens */
    --terra-primary: #c85a32;
    --terra-dark: #a8421d;
    --terra-light: #faefe9;
    --terra-subtle: #fbeee8;

    --sand-gold: #d39035;
    --sand-amber: #e8a855;
    --sand-bg: #f8f6f0;
    --sand-surface: #ffffff;
    --sand-border: #ede4d8;
    --sand-muted: #e7ded0;

    --olive-dark: #1a251e;
    --olive-forest: #2d4536;
    --olive-light: #eef4f0;

    --text-primary: #1e2621;
    --text-secondary: #526056;
    --text-muted: #7c8c82;
    --text-light: #ffffff;

    --shadow-xs: 0 2px 6px rgba(26, 37, 30, 0.04);
    --shadow-sm: 0 4px 14px rgba(26, 37, 30, 0.06);
    --shadow-md: 0 10px 28px rgba(26, 37, 30, 0.09);
    --shadow-lg: 0 20px 44px rgba(26, 37, 30, 0.12);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 50px;

    --transition-fast: 0.18s ease;
    --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.site-body {
    background-color: var(--sand-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--olive-dark);
    line-height: 1.25;
}

a {
    color: var(--terra-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--terra-dark);
}

/* ==========================================================================
   Navigation Bar (Glassmorphic Header)
   ========================================================================== */
.site-navbar {
    background: var(--sand-surface);
    border-bottom: 1px solid var(--sand-border);
    padding: 0.75rem 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.brand-icon-wrap {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--terra-primary), var(--sand-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(200, 90, 50, 0.3);
}

.brand-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.18rem;
    color: var(--olive-dark);
    letter-spacing: -0.02em;
    display: block;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-control-btn {
    background: var(--sand-bg);
    border: 1px solid var(--sand-border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    line-height: 1;
}

.nav-control-btn:hover {
    background: var(--terra-subtle);
    color: var(--terra-primary);
    border-color: rgba(200, 90, 50, 0.3);
}

.theme-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 0;
}

.lang-toggle-btn {
    min-width: 52px;
    height: 34px;
    padding: 0 0.5rem;
}

.nav-item-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-item-link:hover {
    color: var(--terra-primary) !important;
    background: var(--terra-subtle);
}

.nav-icon {
    width: 17px;
    height: 17px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background-color: var(--sand-border);
    margin: 0 0.8rem;
}

.nav-user-badge {
    background: var(--olive-light);
    border-radius: var(--radius-pill);
    padding: 0.25rem 0.75rem 0.25rem 0.3rem;
    margin-right: 0.4rem;
}

.user-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--olive-forest);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.user-name-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--olive-forest);
}

.btn-add-spot {
    background: var(--terra-primary);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(200, 90, 50, 0.32);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-add-spot:hover {
    background: var(--terra-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200, 90, 50, 0.4);
    color: #ffffff !important;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.custom-toggler {
    border: 1px solid var(--sand-border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    color: var(--olive-dark);
}

.toggler-icon {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   Page Headers & Action Bar
   ========================================================================= */
.page-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Search & Filter Bar Component
   ========================================================================== */
.filter-card {
    background: var(--sand-surface);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.4rem;
    box-shadow: var(--shadow-xs);
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.destination-search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: var(--sand-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.destination-search-input:focus {
    outline: none;
    border-color: var(--terra-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.15);
}

.filter-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.filter-pill {
    background: var(--sand-bg);
    color: var(--text-secondary);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-pill);
    padding: 0.32rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--terra-primary);
    color: #ffffff;
    border-color: var(--terra-primary);
    box-shadow: 0 2px 8px rgba(200, 90, 50, 0.28);
}

/* ==========================================================================
   Map Container Wrapper
   ========================================================================== */
.map-card-wrapper {
    background: var(--sand-surface);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.2rem;
}

.map-header-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--sand-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.map-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--olive-forest);
    display: flex;
    align-items: center;
}

.map-toggle-btn {
    background: var(--sand-bg);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.map-toggle-btn:hover {
    background: var(--sand-muted);
}

#map {
    width: 100%;
    height: 380px;
}

.map-card-wrapper.is-collapsed {
    border-bottom: 1px solid var(--sand-border);
}

.map-card-wrapper.is-collapsed .map-header-bar {
    border-bottom: none;
}

#mapContainer.map-collapsed {
    display: none !important;
}

/* ==========================================================================
   Destination Cards Grid
   ========================================================================== */
.spot-card-col {
    margin-bottom: 1.8rem;
}

.spot-card {
    background: var(--sand-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sand-border);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.spot-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(200, 90, 50, 0.3);
}

.spot-card-img-wrap {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: #e2d9cd;
}

.spot-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.spot-card:hover .spot-card-img-wrap img {
    transform: scale(1.06);
}

.spot-card-price {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(26, 37, 30, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.32rem 0.8rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.spot-card-body {
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.spot-card-location {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--terra-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
}

.location-pin-icon {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.spot-card-title {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--olive-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.spot-card-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.spot-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--sand-border);
    padding-top: 0.9rem;
    margin-top: auto;
}

.spot-card-btn {
    background: var(--terra-light);
    color: var(--terra-primary) !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.spot-card-btn:hover {
    background: var(--terra-primary);
    color: #ffffff !important;
}

.btn-arrow-icon {
    width: 14px;
    height: 14px;
    margin-left: 4px;
    transition: transform var(--transition-fast);
}

.spot-card-btn:hover .btn-arrow-icon {
    transform: translateX(3px);
}

/* Empty State */
.empty-state-box {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--sand-surface);
    border: 1px dashed var(--sand-border);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.empty-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--terra-light);
    color: var(--terra-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Show Page (Editorial Travel Guide)
   ========================================================================== */
.spot-hero {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    height: 440px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    background: #1a251e;
}

.spot-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(180deg, transparent 0%, rgba(16, 24, 20, 0.9) 100%);
    color: #ffffff;
}

.spot-hero-overlay h1 {
    color: #ffffff;
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.location-tag {
    display: inline-flex;
    align-items: center;
    color: #fce0bc;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

.spot-panel {
    background: var(--sand-surface);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.8rem;
}

.spot-panel-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--olive-dark);
}

.spot-meta-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: 1.2rem 0;
    flex-wrap: wrap;
}

.price-pill {
    background: var(--terra-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.4rem 1.1rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 12px rgba(200, 90, 50, 0.3);
}

.author-chip {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.spot-actions {
    display: flex;
    gap: 0.6rem;
}

.btn-edit {
    background: var(--olive-forest);
    color: #ffffff;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill);
    border: none;
    text-decoration: none;
}

.btn-edit:hover {
    background: var(--olive-dark);
    color: #ffffff;
}

/* Reviews Styling */
.review-card {
    background: var(--sand-bg);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.review-author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--olive-dark);
    margin-bottom: 0.25rem;
}

/* Sidebar Travel Guide Card */
.travel-guide-card {
    background: var(--sand-surface);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
}

.guide-tip-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
}

.tip-icon {
    width: 20px;
    height: 20px;
    color: var(--terra-primary);
    flex-shrink: 0;
}

/* ==========================================================================
   Form Styling (New & Edit Destinations, Auth)
   ========================================================================== */
.form-panel {
    background: var(--sand-surface);
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 760px;
    margin: 1.5rem auto 3rem;
}

.form-panel-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--olive-dark);
    margin-bottom: 0.4rem;
}

.form-panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--olive-dark);
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--terra-primary);
    box-shadow: 0 0 0 3px rgba(200, 90, 50, 0.15);
    outline: none;
}

.form-submit-btn {
    background: var(--terra-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(200, 90, 50, 0.35);
    transition: all var(--transition-fast);
    width: 100%;
}

.form-submit-btn:hover {
    background: var(--terra-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(200, 90, 50, 0.45);
}

.form-back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1.2rem;
    text-decoration: none;
}

.form-back-link:hover {
    color: var(--terra-primary);
}

/* Existing Image Thumbnail Checkboxes */
.existing-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 0.8rem;
}

.existing-image-item {
    border: 1px solid var(--sand-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--sand-bg);
    padding: 0.4rem;
    text-align: center;
}

.existing-image-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
}

/* ==========================================================================
   Authentication Views (Split Travel Layout)
   ========================================================================== */
.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.auth-card {
    background: var(--sand-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--sand-border);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
}

.auth-card-banner {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.auth-card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-card-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 37, 30, 0.85) 100%);
    color: #ffffff;
}

.auth-card-body {
    padding: 2.2rem;
}

.auth-helper-text {
    text-align: center;
    margin-top: 1.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Flash Alerts
   ========================================================================== */
.custom-flash-alert {
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    border: none;
    box-shadow: var(--shadow-sm);
}

.flash-success {
    background-color: #ecfdf3;
    border-left: 5px solid #12b76a;
    color: #027a48;
}

.flash-danger {
    background-color: #fef3f2;
    border-left: 5px solid #f04438;
    color: #b42318;
}

.flash-icon-box {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flash-icon {
    width: 24px;
    height: 24px;
}

.flash-title {
    font-size: 0.92rem;
    font-family: var(--font-heading);
}

.flash-message {
    font-size: 0.88rem;
}

/* ==========================================================================
   Rich Multi-column Footer
   ========================================================================== */
.site-footer {
    background: var(--olive-dark);
    color: #ffffff;
    margin-top: auto;
}

.footer-brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-tag-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
}

.badge-icon {
    width: 14px;
    height: 14px;
}

.footer-heading {
    font-family: var(--font-heading);
    color: #fce0bc;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.1rem;
}

.footer-links li {
    margin-bottom: 0.55rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-muted-text {
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.btn-outline-terra {
    border: 1px solid var(--terra-primary);
    color: #ffffff;
    background: rgba(200, 90, 50, 0.2);
    border-radius: var(--radius-pill);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-outline-terra:hover {
    background: var(--terra-primary);
    color: #ffffff;
}

.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.footer-subcopy {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.7rem;
    }

    .spot-hero {
        height: 320px;
    }

    .spot-hero-overlay h1 {
        font-size: 1.8rem;
    }

    .form-panel {
        padding: 1.6rem;
    }

    .nav-divider {
        display: none;
    }
}
