/**
 * Palace Tours Display - Layout Builder & Golden Eagle Style
 * Version: 2.0.0
 */

/* =========================================
   ADMIN TOOLBAR (floating bar on tour page)
   ========================================= */
.ptd-layout-admin-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #fff;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}
.ptd-lab-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ptd-lab-label {
    font-weight: 600;
    font-size: 15px;
    margin-right: 8px;
}
.ptd-lab-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ptd-lab-status-draft { background: #fbbf24; color: #1e293b; }
.ptd-lab-status-live { background: #22c55e; color: #fff; }

.ptd-lab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}
.ptd-lab-btn-primary { background: #3b82f6; color: #fff; }
.ptd-lab-btn-primary:hover { background: #2563eb; color: #fff; }
.ptd-lab-btn-secondary { background: #475569; color: #fff; }
.ptd-lab-btn-secondary:hover { background: #64748b; color: #fff; }
.ptd-lab-btn-success { background: #22c55e; color: #fff; }
.ptd-lab-btn-success:hover { background: #16a34a; color: #fff; }
.ptd-lab-btn-warning { background: #f59e0b; color: #1e293b; }
.ptd-lab-btn-warning:hover { background: #d97706; }
.ptd-lab-btn-info { background: #06b6d4; color: #fff; }
.ptd-lab-btn-info:hover { background: #0891b2; color: #fff; }
.ptd-lab-btn-danger { background: #ef4444; color: #fff; }
.ptd-lab-btn-danger:hover { background: #dc2626; color: #fff; }

.ptd-tour-container { padding-bottom: 60px; }


/* =========================================
   LAYOUT EDITOR MODAL
   ========================================= */
.ptd-layout-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ptd-layout-editor {
    background: #fff;
    width: 100%;
    max-width: 1100px;
    margin: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
.ptd-le-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #1e293b;
    color: #fff;
    flex-shrink: 0;
}
.ptd-le-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.ptd-le-header-actions {
    display: flex;
    gap: 8px;
}
.ptd-le-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.ptd-le-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 16px;
}

/* Section */
.ptd-le-section {
    margin-bottom: 32px;
}
.ptd-le-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Day card */
.ptd-le-day-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.ptd-le-day-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f1f5f9;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}
.ptd-le-day-header:hover { background: #e2e8f0; }
.ptd-le-day-num {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #8b7355;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}
.ptd-le-day-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.ptd-le-day-img-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}
.ptd-le-day-img-badge.no-image {
    background: #fef3c7;
    color: #92400e;
}
.ptd-le-day-pos-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 600;
    text-transform: uppercase;
}
.ptd-le-day-toggle {
    color: #94a3b8;
    transition: transform 0.2s;
    font-size: 11px;
}
.ptd-le-day-card.expanded .ptd-le-day-toggle { transform: rotate(180deg); }

.ptd-le-day-body {
    display: none;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}
.ptd-le-day-card.expanded .ptd-le-day-body { display: block; }

/* Day editor grid */
.ptd-le-day-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

/* Square image preview */
.ptd-le-image-preview {
    width: 200px;
    height: 200px;
    background: #e8e0d4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.ptd-le-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ptd-le-image-preview .ptd-le-no-image {
    color: #a08060;
    font-size: 12px;
    text-align: center;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.ptd-le-image-preview .ptd-le-no-image svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.ptd-le-image-options {
    min-width: 0;
}
.ptd-le-image-options label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Position selector */
.ptd-le-position-group {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.ptd-le-pos-btn {
    flex: 1;
    padding: 7px 4px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.15s;
}
.ptd-le-pos-btn:hover { border-color: #94a3b8; }
.ptd-le-pos-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Source buttons */
.ptd-le-img-source-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ptd-le-img-src-btn {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    transition: all 0.15s;
}
.ptd-le-img-src-btn:hover { background: #f1f5f9; }

/* AI content section */
.ptd-le-ai-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}
.ptd-le-ai-preview {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: #451a03;
    max-height: 130px;
    overflow-y: auto;
    margin-bottom: 8px;
}
.ptd-le-ai-preview p { margin: 0 0 6px; }
.ptd-le-ai-preview p:last-child { margin: 0; }
.ptd-le-ai-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #d97706;
    background: #fef3c7;
    padding: 1px 6px;
    border-radius: 3px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* DB images */
.ptd-le-db-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 6px;
}
.ptd-le-db-img-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.15s;
    aspect-ratio: 1;
}
.ptd-le-db-img-item:hover { border-color: #3b82f6; }
.ptd-le-db-img-item.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}
.ptd-le-db-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ptd-le-img-title-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
}
.ptd-le-img-title-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Toast */
.ptd-le-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 200000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: ptdToastIn 0.3s ease;
}
.ptd-le-toast.success { background: #16a34a; }
.ptd-le-toast.error { background: #dc2626; }
@keyframes ptdToastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .ptd-le-day-grid {
        grid-template-columns: 1fr;
    }
    .ptd-le-image-preview {
        width: 100%;
        height: 180px;
    }
}


/* =========================================
   GOLDEN EAGLE TWO-COLUMN ITINERARY
   ========================================= */

/* Overview */
.ptd-overview-new .ptd-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--ptd-text-dark, #1a1a1a);
    text-align: center;
    margin: 0 0 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}
.ptd-overview-prose {
    max-width: 860px;
    margin: 0 auto;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.9;
    color: #333;
}
.ptd-overview-prose p { margin: 0 0 1.5em; }
.ptd-overview-prose img { max-width: 100%; height: auto; border-radius: 4px; margin: 1em 0; }

/* Itinerary title */
.ptd-itinerary-new .ptd-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--ptd-text-dark, #1a1a1a);
    text-align: center;
    margin: 0 0 48px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

/* Days container */
.ptd-ge-days {
    max-width: 1100px;
    margin: 0 auto;
}

/* Each day: two-column grid with fixed image size */
.ptd-ge-day {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start !important;
}

/* Image LEFT */
.ptd-ge-day-img-left {
    grid-template-columns: 450px 1fr;
}
.ptd-ge-day-img-left .ptd-ge-day-image-col { order: 1; }
.ptd-ge-day-img-left .ptd-ge-day-text-col { order: 2; }

/* Image RIGHT */
.ptd-ge-day-img-right {
    grid-template-columns: 1fr 450px;
}
.ptd-ge-day-img-right .ptd-ge-day-image-col { order: 2; }
.ptd-ge-day-img-right .ptd-ge-day-text-col { order: 1; }

/* Image column — fixed 450x450 square */
.ptd-ge-day-image-col {
    position: relative;
    overflow: hidden;
    width: 450px !important;
    height: 450px !important;
    max-height: 450px !important;
    background: #e8e0d4;
    flex-shrink: 0;
    align-self: start !important;
}
.ptd-ge-day-image-col img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    max-width: none !important;
}
.ptd-ge-day-image-col.ptd-ge-clickable {
    cursor: pointer;
}
.ptd-ge-day-image-col.ptd-ge-clickable:hover {
    opacity: 0.9;
}
.ptd-ge-img-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    font-style: italic;
}

/* Placeholder — matches 450x450 */
.ptd-ge-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e8e0d4;
    color: #a08060;
    gap: 12px;
}
.ptd-ge-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.35;
}
.ptd-ge-placeholder span {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.4;
}

/* Text column — matches image height */
.ptd-ge-day-text-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important;
    align-self: start !important;
    padding: 20px 44px 36px;
    background: #fff;
    min-height: 450px;
    margin-top: 0 !important;
}
.ptd-ge-day-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--ptd-accent, #8b7355);
    margin-bottom: 8px;
}
.ptd-ge-day-city {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ptd-text-dark, #1a1a1a);
    margin: 0 0 20px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ptd-ge-day-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}
.ptd-ge-day-content p { margin: 0 0 1em; }
.ptd-ge-day-content p:last-child { margin-bottom: 0; }

/* Alternate bg */
.ptd-ge-day:nth-child(even) .ptd-ge-day-text-col {
    background: #faf9f7;
}

/* Inline AI rewrite button (admin only, on page) */
.ptd-ge-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    padding: 6px 14px;
    border: 1px solid #d4a574;
    border-radius: 20px;
    background: #fff;
    color: #8b6914;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s;
}
.ptd-ge-ai-btn:hover {
    background: #fef3c7;
    border-color: #b8860b;
}
.ptd-ge-ai-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Image picker overlay (shows gallery + upload option) */
.ptd-ge-img-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ptd-ge-img-picker {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.ptd-ge-img-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e293b;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}
.ptd-ge-img-picker-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}
.ptd-ge-img-picker-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.ptd-ge-img-picker-actions button {
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #334155;
}
.ptd-ge-img-picker-actions button:hover { background: #f1f5f9; }
.ptd-ge-img-picker-actions button.active {
    background: #1e293b;
    color: #fff;
    border-color: #1e293b;
}
.ptd-ge-img-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.ptd-ge-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.ptd-ge-img-grid-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.15s;
}
.ptd-ge-img-grid-item:hover {
    border-color: #3b82f6;
    transform: scale(1.03);
}
.ptd-ge-img-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.ptd-ge-img-picker-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}
.ptd-ge-img-picker-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 960px) {
    .ptd-ge-day,
    .ptd-ge-day-img-left,
    .ptd-ge-day-img-right {
        grid-template-columns: 1fr;
    }
    .ptd-ge-day-img-left .ptd-ge-day-image-col,
    .ptd-ge-day-img-right .ptd-ge-day-image-col { order: 1; }
    .ptd-ge-day-img-left .ptd-ge-day-text-col,
    .ptd-ge-day-img-right .ptd-ge-day-text-col { order: 2; }
    .ptd-ge-day-image-col {
        width: 100%;
        height: 300px;
    }
    .ptd-ge-day-text-col {
        padding: 28px 24px;
        min-height: auto;
    }
    .ptd-ge-day-city { font-size: 20px; }
}
@media (max-width: 600px) {
    .ptd-ge-day-image-col { height: 240px; }
    .ptd-ge-day-text-col { padding: 20px 16px; }
    .ptd-itinerary-new .ptd-section-title { font-size: 24px; margin-bottom: 32px; }
}
