:root {
    --primary-gold: #c5a059;
    --primary-gold-hover: #d4af37;
    --bg-dark: #121212;
    --bg-lighter: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-light: #ffffff;
    --text-muted: #aaaaaa;
    --error-red: #f44336;
    --error-red-hover: #d32f2f;
    color-scheme: dark;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

/* Header */
header {
    background-color: var(--bg-lighter);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-gold);
    text-decoration: none;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions a:not(.btn) {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.header-actions a:not(.btn):hover {
    color: var(--primary-gold);
}

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

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    resize: none;
    vertical-align: middle;
    margin: 0;
}

option {
    padding: 0;
    margin: 0;
}

#description {
    min-height: 120px;
}

.auto-expand {
    overflow: hidden;
    line-height: normal;
}

input:focus,
select:focus,
textarea:focus,
.custom-select-display:focus {
    outline: none;
    border-color: var(--primary-gold);
}

/* Fix browser autofill background color */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-light) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-error {
    border: 1px solid var(--error-red) !important;
    box-shadow: 0 0 0 1px var(--error-red) !important;
    background-color: rgba(244, 67, 54, 0.05) !important;
}

.error-text {
    color: var(--error-red);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-gold);
    color: var(--bg-dark);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: middle;
    margin: 0;
}

.btn:hover,
.btn:focus {
    background-color: var(--primary-gold-hover);
    outline: none;
}

.btn-danger {
    background-color: var(--error-red);
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: var(--error-red-hover);
}

/* Login Box */
.login-box {
    max-width: 400px;
    margin: 4rem auto;
    background-color: var(--bg-lighter);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.login-box h1 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary-gold);
    text-align: center;
}

.login-error {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--error-red);
    border: 1px solid var(--error-red);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Dashboard Tools */
.dashboard-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.city-select {
    min-width: 400px;
}

/* Restaurant List */
.restaurant-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background-color: var(--bg-lighter);
    border-radius: 8px;
}

.restaurant-table th,
.restaurant-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.restaurant-table th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 500;
}
.restaurant-table th:first-child {
    border-top-left-radius: 8px;
}
.restaurant-table th:last-child {
    border-top-right-radius: 8px;
}

.thumb-cell {
    width: 100px;
}

.thumb-cell img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.name-cell h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.name-cell p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.rating-row {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.stars {
    color: var(--primary-gold);
    font-size: 1.2rem;
}
.lang-switch {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
    margin-left: 1rem;
}

.lang-switch a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 6px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.lang-switch a:first-child {
    border-right: 1px solid rgba(197, 160, 89, 0.3);
}

.lang-switch a:hover {
    background-color: rgba(197, 160, 89, 0.1);
    color: var(--primary-gold);
}

.lang-switch a.active {
    background-color: rgba(197, 160, 89, 0.2);
    color: var(--primary-gold);
}

.lang-switch a:hover .flag-icon,
.lang-switch a.active .flag-icon {
    filter: none;
}

.flag-icon {
    width: 18px;
    height: auto;
    filter: sepia(100%) hue-rotate(5deg) saturate(200%) brightness(0.6) contrast(1.2);
    transition: filter 0.3s ease;
}

/* Autocomplete */
.autocomplete-suggestions {
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-lighter);
    overflow: auto;
    max-height: 200px;
    position: absolute;
    z-index: 9999;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.autocomplete-suggestion {
    padding: 10px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}
.autocomplete-suggestion:hover,
.autocomplete-suggestion.focused {
    background: rgba(197, 160, 89, 0.2);
}
.autocomplete-suggestion strong {
    font-weight: normal;
    color: var(--primary-gold);
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-wrapper.is-open {
    z-index: 10000;
}
.custom-select-display {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    position: relative;
    z-index: 2;
    vertical-align: middle;
    margin: 0;
    line-height: normal;
}
.custom-select-display.open {
    border-color: var(--primary-gold);
}
.custom-select-display .chevron {
    transition: transform 0.3s ease;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}
.custom-select-display.open .chevron {
    transform: rotate(180deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bg-lighter);
    overflow: auto;
    max-height: 250px;
    z-index: 1;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.2s ease;
}
.custom-select-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-select-option {
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-option:hover {
    background: rgba(197, 160, 89, 0.2) !important;
}
.custom-select-option.focused {
    background: rgba(197, 160, 89, 0.2);
}
.custom-select-options:hover .custom-select-option.focused {
    background: transparent;
}
.custom-select-display.small {
    padding: 4px 10px;
    font-size: 0.85rem;
    min-height: auto;
}
.custom-select-display.small .chevron svg {
    width: 14px;
    height: 14px;
}
.custom-select-display.small + .custom-select-options .custom-select-option {
    font-size: 0.85rem;
    padding: 4px 10px;
}

.custom-select-option.selected {
    color: var(--primary-gold);
}

.custom-select-option.multi-option {
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-select-option.multi-option input[type="checkbox"] {
    accent-color: var(--primary-gold);
    width: 14px;
    height: 14px;
    margin: 0;
}

/* Star Rating */
.review-row {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.review-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.review-stars {
    font-size: 1.6rem;
    color: #444;
    cursor: pointer;
    display: inline-block;
}
.review-stars .star {
    transition: color 0.2s;
}
.review-stars .star.active,
.review-stars .star:hover,
.review-stars:hover .star {
    color: var(--primary-gold);
}
.review-stars .star:hover ~ .star {
    color: #444;
}
.review-desc-container {
    margin-top: 0.5rem;
    display: none; /* hidden by default until a star is clicked */
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(197, 160, 89, 0.5);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}
.dropzone:hover, .dropzone.dragover {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--primary-gold);
}

/* Image Table */
.img-row {
    background: var(--bg-input);
}
.drag-handle {
    cursor: grab;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0 10px;
}
.drag-handle:active {
    cursor: grabbing;
}
.img-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--text-muted);
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    user-select: none;
}

.lightbox-close:hover {
    color: var(--primary-gold);
}

.lightbox-controls {
    position: absolute;
    top: 20px;
    left: 40px;
    display: flex;
    gap: 1.5rem;
    z-index: 100000;
}

.lightbox-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s;
    user-select: none;
}

.lightbox-btn:hover {
    color: var(--primary-gold);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 3rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    border-radius: 8px;
    z-index: 100000;
}

.lightbox-nav-btn:hover {
    background: rgba(197, 160, 89, 0.8);
    color: #fff;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.img-desc-input {
    width: 100%;
    resize: none;
    overflow: hidden;
    min-height: 40px;
}

/* Property Badges */
.property-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.property-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.property-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.property-badge.active {
    background: rgba(197, 160, 89, 0.1);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

/* Guide Specific Styles */
.text-center { text-align: center; }

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
h1 span {
    display: block;
    font-size: 0.9rem;
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}
p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}
.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}
.form-control:focus {
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
}
.btn:active {
    transform: scale(0.98);
}

/* OTP Inputs */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.otp-input {
    width: 3rem;
    height: 4rem;
    text-align: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    outline: none;
}
.otp-input:focus {
    border-color: var(--primary-gold);
}
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Sortable JS Drag & Drop Styles */
.sortable-drag-clone {
    background: var(--bg-surface) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    opacity: 0.95 !important;
    z-index: 999999 !important;
    cursor: grabbing !important;
}

.sortable-ghost-placeholder {
    opacity: 1 !important;
    background: rgba(197, 160, 89, 0.05) !important;
    outline: 2px dashed var(--primary-gold) !important;
    outline-offset: -2px;
}

.sortable-ghost-placeholder > td {
    visibility: hidden !important;
}

/* Responsive Table */
@media (max-width: 768px) {
    .restaurant-table thead {
        display: none;
    }
    .restaurant-table, 
    .restaurant-table tbody, 
    .restaurant-table tr, 
    .restaurant-table td {
        display: block;
        width: 100%;
    }
    .restaurant-table tr {
        margin-bottom: 1rem;
        background: rgba(255,255,255,0.02);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        position: relative;
        padding-left: 110px; /* space for thumb */
        min-height: 100px;
    }
    .restaurant-table td {
        border-bottom: none;
        padding: 0.5rem 1rem 0.5rem 0;
    }
    .restaurant-table .thumb-cell {
        position: absolute;
        left: 10px;
        top: 10px;
        padding: 0;
        width: 90px;
    }
    .restaurant-table .thumb-cell img {
        width: 90px;
        height: 90px;
    }
    .restaurant-table .actions-cell {
        padding-top: 0;
    }
    .header-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* =========================================================
   WYSIWYG Text Editor
   ========================================================= */

.wysiwyg-wrapper {
    margin-top: 5px;
}

.wysiwyg-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--bg-card, #2A2A2A);
    border: 1px solid var(--border-color, #333);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    position: relative;
}

.wysiwyg-btn {
    flex: 0 0 auto;
    background: var(--bg-card, #2A2A2A);
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color, #E0E0E0);
    text-align: center;
    transition: background 0.15s, color 0.15s;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wysiwyg-btn:hover {
    background: var(--primary-light, #3A3A3A);
    color: var(--primary-gold, #D4AF37);
}

.wysiwyg-btn.active {
    background: var(--primary-gold, #D4AF37);
    color: #111;
    border-color: var(--primary-gold, #D4AF37);
}

.wysiwyg-btn-sep {
    width: 1px;
    background: var(--border-color, #333);
    flex: 0 0 1px;
    margin: 2px 6px;
}

.wysiwyg-editor {
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #333);
    border-radius: 0 0 4px 4px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color, #E0E0E0);
    background: var(--bg-card, #2A2A2A);
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.wysiwyg-editor:focus {
    border-color: var(--primary-gold, #D4AF37);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.wysiwyg-editor h1 {
    font-size: 22pt;
    font-weight: 600;
    color: var(--primary-gold, #D4AF37);
    margin-top: 15px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.wysiwyg-editor > *:first-child {
    margin-top: 0 !important;
}

.wysiwyg-editor h2 {
    font-weight: 600;
    font-size: 16pt;
    color: #E0E0E0;
    border-bottom: 1px solid #444;
    padding-bottom: 4px;
    margin-top: 15px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.wysiwyg-editor p {
    margin-top: 0;
    margin-bottom: 8px;
}

.wysiwyg-editor ul {
    padding-left: 24px;
    margin: 8px 0;
    list-style-type: disc;
}

.wysiwyg-editor ul ul {
    padding-left: 20px;
    list-style-type: circle;
}

.wysiwyg-editor ol {
    padding-left: 24px;
    margin: 8px 0;
    list-style-type: decimal;
}

.wysiwyg-editor li {
    margin: 4px 0;
}

/* =========================================
   Mobile Optimization 
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .restaurant-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .login-box {
        margin: 2rem auto;
        padding: 1.5rem;
    }
}