:root {
    --lg-green: #166534;
    --lg-font: 'DM Sans', sans-serif;
    --lg-bg-gray: #f3f4f6;
}

/* ✅ ADDED: Too-soon (min booking notice) */
.lg-day.too-soon {
    background: #fef3c7;
    color: #92400e;
}
.lg-day.too-soon::after {
    background: #f59e0b;
}

body.lg-modal-open { overflow: hidden; }

.lg-container { max-width: 1200px; margin: 40px auto; font-family: var(--lg-font); padding: 0 20px; }
.lg-page-title { text-align: center; font-size: 32px; margin-bottom: 20px; }

/* SEARCH */
.lg-search-wrapper { max-width: 400px; margin: 0 auto 40px; position: relative; }
#lg-frontend-search {
    width: 100%; padding: 12px 20px 12px 45px; border: 1px solid #ddd; border-radius: 30px;
    font-size: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.lg-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #999; }

/* GRID */
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }

.lg-card {
    border-radius: 20px; overflow: hidden; cursor: pointer; position: relative;
    aspect-ratio: 3/4; transition: transform 0.2s;
}
.lg-card:hover { transform: scale(1.02); }
.lg-card-bg { width: 100%; height: 100%; background-size: cover; background-position: center; position: relative; }

/* UNAVAILABLE */
.lg-badge-unav { position: absolute; top: 15px; right: 15px; background: #e11d48; color: white; padding: 5px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; z-index: 5; }

/* CARD OVERLAY */
.lg-card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    padding: 20px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; height: 60%;
}
.lg-name { margin: 0 0 8px 0; font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.lg-meta-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.lg-meta-pill { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; backdrop-filter: blur(5px); }
.lg-tags-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 15px; }
.lg-tag-pill { background: rgba(255,255,255,0.9); color: #333; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

/* ✅ FIXED: Greyed-out button when guide is unavailable */
.lg-btn-view-profile {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
    color: #fff; padding: 8px; border-radius: 8px; width: 100%; cursor: pointer; font-size: 14px;
    transition: background 0.2s;
}
.lg-btn-view-profile:hover:not(:disabled) { 
    background: rgba(255,255,255,0.3); 
}
.lg-btn-view-profile:disabled {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
    cursor: not-allowed;
    opacity: 0.7;
}

/* MODAL — ✅ FIXED TO MATCH SCREENSHOT */
#lg-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    overflow: auto;
}
#lg-modal {
    background: #fff; width: 95%; max-width: 900px; border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.lg-close {
    position: absolute; top: 15px; right: 15px;
    background: #fff; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 20;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ✅ PROFILE POPUP — FIXED: Fills entire space */
.lg-modal-left {
    flex: 0 0 40%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lg-hero-image {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 16px;
}
.lg-modal-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.lg-modal-title { font-size: 28px; font-weight: 700; margin: 0 0 12px; color: #111; }
.lg-subtitle { font-size: 18px; color: #4b5563; margin: 0 0 12px; }
.lg-description {
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 24px;
    flex: 1;
}
.lg-tags-row {
    display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0;
}
.lg-tag-pill {
    background: #f3f4f6; padding: 6px 12px; border-radius: 20px; font-size: 13px;
    display: inline-flex; align-items: center; gap: 5px;
}
.lg-tag-pill i {
    color: #f59e0b;
    font-size: 12px;
}
.lg-btn-green {
    background: var(--lg-green); color: #fff; border: none;
    padding: 14px; border-radius: 30px; font-size: 16px;
    font-weight: 600; cursor: pointer; width: 100%;
    transition: 0.2s;
    margin-top: auto;
}
.lg-btn-green:hover { background: #14532d; }
.lg-btn-green:disabled { background: #ccc; cursor: not-allowed; }

/* CALENDAR & TIME — ✅ FULL SPACE */
.lg-modal-right.calendar-step {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}
.lg-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 8px; margin: 15px 0;
}
.lg-day {
    padding: 10px; text-align: center; cursor: pointer;
    border-radius: 8px; background: #fff;
}
.lg-day:hover:not(.blocked):not(.past):not(.booked):not(.too-soon) { background: #f0f9ff; }
.lg-day.selected { background: var(--lg-green); color: #fff; }
.lg-day.blocked,
.lg-day.past,
.lg-day.booked,
.lg-day.too-soon {
    cursor: not-allowed;
    position: relative;
}
.lg-day::after {
    content: '';
    position: absolute; top: 4px; right: 4px; width: 6px; height: 6px;
    background: #166534; border-radius: 50%;
}
.lg-day.blocked.unavailable::after { background: #e11d48; }
.lg-day.past::after { background: #9ca3af; }
.lg-time-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px; margin: 15px 0;
}
.lg-time-slot {
    padding: 8px; border: 1px solid #ddd;
    border-radius: 6px; text-align: center;
    cursor: pointer; font-size: 12px;
}
.lg-time-slot.selected { background: var(--lg-green); color: #fff; }
.lg-time-slot.booked,
.lg-time-slot.past {
    background: #f3f4f6; color: #999;
    cursor: not-allowed; opacity: 0.6;
}
.lg-textarea {
    width: 100%; padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px; height: 80px;
    margin-bottom: 20px;
}

@media (max-width: 768px) { 
    #lg-modal { flex-direction: column; } 
    .lg-modal-left, .lg-modal-right { flex: auto; } 
    .lg-modal-left { height: 250px; } 
    .lg-hero-image { height: 100%; }
    .lg-modal-right { padding: 20px; }
}

.lg-hidden { display: none !important; }

/* ✅ GUIDE DASHBOARD — FRUITFUL STYLE */
.lg-guide-dashboard-frontend { max-width: 1000px; margin: 0 auto; font-family: var(--lg-font); padding: 0 20px; }
.lg-dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.lg-guide-name { font-weight: 600; color: var(--lg-green); }

/* ✅ FIXED: Settings Button — Circle, Gear Icon */
.lg-settings-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #4b5563;
    font-weight: bold;
    transition: all 0.2s ease;
}
.lg-settings-btn:hover {
    background: var(--lg-green);
    color: white;
    transform: scale(1.05);
}

/* ✅ FIXED: Calendar Nav Buttons — Circle, Bold Arrows */
.lg-cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f9f9f9;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-weight: bold;
    font-family: sans-serif;
    font-size: 18px;
    transition: all 0.2s ease;
}
.lg-cal-nav-btn:hover {
    background: var(--lg-green);
    color: white;
    border-color: var(--lg-green);
    transform: scale(1.05);
}

/* Stats Grid — Compact, 4-in-a-row */
.lg-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.lg-stat-card {
    background: #fff; padding: 16px; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    text-align: center;
}
.lg-stat-value {
    font-size: 28px; font-weight: 700; color: var(--lg-green); margin: 0 0 5px;
}
.lg-stat-label {
    font-size: 14px; color: #666; margin: 0;
}

/* Calendar Wrapper */
.lg-dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.lg-calendar-wrapper {
    background: #fff; padding: 24px; border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}
.lg-calendar-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.lg-calendar-header h3 {
    margin: 0; font-size: 20px; font-weight: 700; color: #111;
}

/* Calendar Grid */
.lg-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.lg-cal-day {
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 8px 0;
}
.lg-cal-cell {
    background: #fff; border: 1px solid #ddd; border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}
.lg-cal-cell:hover {
    background: #f9f9f9;
}
.lg-cal-cell.empty {
    background: transparent;
    border: none;
    padding: 0;
}
.lg-cal-cell.has-bookings {
    background: #e0f2fe;
}
.lg-cal-cell.unavailable {
    background: #fee2e2;
}
.lg-cal-date {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}
.lg-cal-bookings {
    font-size: 12px;
    color: #166534;
    font-weight: 600;
}

/* Upcoming Bookings Sidebar */
.lg-upcoming-bookings {
    background: #fff; padding: 24px; border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}
.lg-upcoming-bookings h3 {
    margin: 0 0 20px; font-size: 20px; font-weight: 700;
    color: #111;
}
.lg-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lg-upcoming-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}
.lg-upcoming-item strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.lg-upcoming-item div {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}
.lg-upcoming-item em {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* POPUPS */
#lg-booking-popup,
#lg-settings-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.lg-popup-content {
    background: white; width: 100%; max-width: 500px;
    padding: 30px; border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}
.lg-close-popup {
    position: absolute; top: 15px; right: 15px;
    font-size: 24px; cursor: pointer; color: #999;
}
.lg-popup-content h4 {
    margin: 0 0 20px; font-size: 20px; font-weight: 700;
}
#popup-bookings-list { margin-top: 15px; }
.booking-item {
    padding: 12px 0; border-bottom: 1px solid #eee;
}
.booking-item:last-child { border-bottom: none; }
.booking-item strong { display: block; font-weight: 600; }
.booking-item em { color: #666; font-size: 13px; }

.booking-item.lg-booking-done {
    background: #dcfce7;
    border-left: 3px solid #16a34a;
}
.booking-item.lg-booking-done strong::after {
    content: " ✅";
    color: #16a34a;
    margin-left: 6px;
}

/* Settings Popup */
.lg-settings-popup { max-width: 450px; }
.lg-settings-popup h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}
.lg-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.lg-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.lg-setting-row span {
    flex: 1; font-size: 15px; color: #374151;
}
.lg-setting-row input[type="checkbox"] {
    width: 20px; height: 20px;
    accent-color: var(--lg-green);
}
.lg-setting-row input[type="time"],
.lg-setting-row input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    width: 120px;
}
#lg-make-unavailable,
#lg-save-settings {
    width: 100%;
    margin-top: 20px;
}

/* Calendar Styling */
.booked-date a {
    background: var(--lg-green) !important;
    color: white !important;
}
.unavailable-date a {
    background: #e11d48 !important;
    color: white !important;
}

/* ✅ Theme-colored Done/Cancel buttons */
.lg-btn-done-cancel-done {
    background: #166534;
    color: white;
}
.lg-btn-done-cancel-done:hover {
    background: #14532d;
}

.lg-btn-done-cancel-cancel {
    background: #d97706;
    color: white;
}
.lg-btn-done-cancel-cancel:hover {
    background: #b45309;
}

/* Small button for Done/Cancel */
.lg-btn-small {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.booking-item .lg-booking-actions {
    margin-top: 8px;
}