/*
 * Tratok Hospitality — Service Provider Guide
 * Standalone styling for guide.php. Re-uses platform.css custom properties
 * so the guide automatically inherits the dark theme, gold accent, and
 * typography decisions from the rest of the portal.
 */

/* ------------------------------------------------------------------ */
/* Layout shell                                                        */
/* ------------------------------------------------------------------ */

.guide-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    color: var(--text-secondary);
}

/* Hero ------------------------------------------------------------- */

.guide-hero {
    margin-top: 28px;
    margin-bottom: 32px;
    padding: 36px 40px;
    background: linear-gradient(135deg,
        rgba(212, 168, 67, 0.08) 0%,
        rgba(96, 165, 250, 0.04) 60%,
        transparent 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}
.guide-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--gold-400), var(--gold-500), #60a5fa);
}
.guide-hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-400);
    margin-bottom: 10px;
}
.guide-hero h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.guide-hero p {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 0 22px;
}
.guide-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.guide-lang-wrap {
    position: relative;
    display: inline-block;
}
.guide-lang-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    min-width: 140px;
    justify-content: space-between;
}
.guide-lang-picker:hover,
.guide-lang-wrap.open .guide-lang-picker {
    border-color: var(--gold-400);
    color: var(--gold-400);
}
.guide-lang-picker > span { flex: 1; text-align: start; }
.guide-lang-picker i { font-size: 0.78rem; }
.guide-lang-caret {
    transition: transform 0.18s ease;
    color: var(--text-muted);
}
.guide-lang-wrap.open .guide-lang-caret { transform: rotate(180deg); }

.guide-lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 240px;
    max-height: 380px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    list-style: none;
    margin: 0;
    padding: 6px;
    z-index: 100;
}
.guide-lang-menu li { margin: 0; }
.guide-lang-menu a {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.12s ease, color 0.12s ease;
    font-size: 0.85rem;
}
.guide-lang-menu a:hover {
    background: rgba(212, 168, 67, 0.06);
    color: var(--text-primary);
}
.guide-lang-menu a.is-current {
    background: rgba(212, 168, 67, 0.1);
    color: var(--gold-400);
    font-weight: 600;
}
.guide-lang-code {
    background: var(--bg-elevated);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: var(--font-display, monospace);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-muted);
}
.guide-lang-menu a.is-current .guide-lang-code {
    background: var(--gold-400);
    color: #1a1d29;
}
.guide-lang-native { font-weight: 600; }
.guide-lang-english {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.guide-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
    color: #1a1d29;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.guide-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 168, 67, 0.25);
    color: #1a1d29;
}

.guide-meta {
    display: flex;
    gap: 20px;
    margin-top: 18px;
    flex-wrap: wrap;
    font-size: 0.74rem;
    color: var(--text-muted);
}
.guide-meta span i {
    color: var(--gold-400);
    margin-right: 4px;
}

/* Two-column shell ------------------------------------------------- */

.guide-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 36px;
    align-items: flex-start;
    margin-bottom: 80px;
}

/* Sidebar (sticky TOC) -------------------------------------------- */

.guide-sidebar {
    position: sticky;
    top: 90px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}
.guide-sidebar::-webkit-scrollbar { width: 6px; }
.guide-sidebar::-webkit-scrollbar-track { background: transparent; }
.guide-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.guide-search {
    position: relative;
    margin-bottom: 14px;
}
.guide-search input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    box-sizing: border-box;
}
.guide-search input:focus {
    outline: none;
    border-color: var(--gold-400);
    background: var(--bg-card);
}
.guide-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: var(--text-muted);
    pointer-events: none;
}

.guide-toc-heading {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 8px 0 8px;
    padding-left: 4px;
}

.guide-toc {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-toc li { margin: 0; }
.guide-toc a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin: 1px 0;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.35;
    transition: all 0.12s ease;
    border-left: 2px solid transparent;
}
.guide-toc a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.guide-toc a.active {
    color: var(--gold-400);
    background: rgba(212, 168, 67, 0.06);
    border-left-color: var(--gold-400);
    font-weight: 600;
}
.guide-toc-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-display);
}
.guide-toc a.active .guide-toc-num {
    background: var(--gold-400);
    color: #1a1d29;
}

/* Main content ---------------------------------------------------- */

.guide-content {
    min-width: 0; /* allow children to shrink under grid */
}

.guide-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    margin-bottom: 28px;
    scroll-margin-top: 80px;
    transition: opacity 0.2s ease;
}
.guide-section.is-hidden {
    display: none;
}

.guide-section-num {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold-400);
    padding: 3px 10px;
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: var(--radius-full);
    margin-bottom: 14px;
}

.guide-section h1 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0 0 14px;
    font-weight: 700;
    letter-spacing: -0.005em;
}
.guide-section h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--text-primary);
    margin: 28px 0 10px;
    font-weight: 700;
    position: relative;
    scroll-margin-top: 80px;
}
.guide-section h3 {
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--gold-400);
    margin: 18px 0 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.anchor-link {
    opacity: 0;
    margin-left: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.guide-section h2:hover .anchor-link,
.guide-section h2 .anchor-link:focus { opacity: 0.7; }
.anchor-link:hover { color: var(--gold-400); opacity: 1 !important; }

/* Paragraphs ------------------------------------------------------- */

.guide-section p {
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 12px;
}
.guide-section p strong,
.guide-section li strong { color: var(--text-primary); font-weight: 700; }

/* Lists ------------------------------------------------------------ */

.guide-section ol.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 8px 0 16px;
}
.guide-section ol.steps > li {
    counter-increment: step;
    position: relative;
    padding: 10px 14px 10px 50px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.guide-section ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 11px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gold-400);
    color: #1a1d29;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.guide-section ul.bullets {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px;
}
.guide-section ul.bullets > li {
    position: relative;
    padding: 4px 0 4px 20px;
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--text-secondary);
}
.guide-section ul.bullets > li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-400);
}

/* Field table ------------------------------------------------------ */

.guide-fields {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 10px 0 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.86rem;
}
.guide-fields thead th {
    background: rgba(212, 168, 67, 0.08);
    color: var(--gold-400);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.guide-fields tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    line-height: 1.55;
}
.guide-fields tbody tr:last-child td { border-bottom: 0; }
.guide-fields tbody td:first-child {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    width: 28%;
}
.guide-fields tbody td:last-child {
    color: var(--text-secondary);
}

/* Callouts --------------------------------------------------------- */

.callout {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 14px 0 16px;
    border: 1px solid;
    font-size: 0.9rem;
    line-height: 1.6;
    align-items: flex-start;
}
.callout-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
}
.callout-body { flex: 1; min-width: 0; }
.callout-body strong { font-weight: 700; }
.callout-label {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 8px;
}
.callout-heading {
    display: inline;
    font-weight: 700;
    color: var(--text-primary);
}
.callout-text { margin-top: 4px; }
.callout-text p { margin: 0; }
.callout-text p + p { margin-top: 8px; }

.callout-tip {
    background: rgba(212, 168, 67, 0.06);
    border-color: rgba(212, 168, 67, 0.3);
}
.callout-tip .callout-icon {
    background: rgba(212, 168, 67, 0.15);
    color: var(--gold-400);
}
.callout-tip .callout-label { color: var(--gold-400); }

.callout-note {
    background: rgba(96, 165, 250, 0.06);
    border-color: rgba(96, 165, 250, 0.28);
}
.callout-note .callout-icon {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}
.callout-note .callout-label { color: #60a5fa; }

.callout-warn {
    background: rgba(248, 113, 113, 0.06);
    border-color: rgba(248, 113, 113, 0.28);
}
.callout-warn .callout-icon {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.callout-warn .callout-label { color: #f87171; }

/* Back-to-top ------------------------------------------------------ */

.guide-totop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gold-400);
    color: #1a1d29;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 80;
}
.guide-totop.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.guide-totop:hover { background: var(--gold-500); }

/* Mobile drawer trigger ------------------------------------------- */

.guide-toc-trigger {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 18px;
    font-family: inherit;
}

/* Highlights from search ------------------------------------------ */

mark.guide-highlight {
    background: rgba(212, 168, 67, 0.35);
    color: var(--text-primary);
    border-radius: 3px;
    padding: 0 2px;
}

.guide-search-empty {
    background: var(--bg-card);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.guide-search-empty i {
    display: block;
    font-size: 1.6rem;
    color: var(--gold-400);
    margin-bottom: 10px;
}

/* Responsive ------------------------------------------------------- */

@media (max-width: 960px) {
    .guide-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .guide-toc-trigger { display: inline-flex; }
    .guide-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        max-height: 100vh;
        height: 100vh;
        width: 88%;
        max-width: 340px;
        z-index: 200;
        border-radius: 0;
        border-right: 1px solid var(--border-default);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
    }
    .guide-sidebar.open { transform: translateX(0); }
    .guide-section { padding: 24px 22px; }
    .guide-hero { padding: 26px 22px; }
    .guide-hero h1 { font-size: 1.6rem; }
    .guide-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 199;
    }
    .guide-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 560px) {
    .guide-wrapper { padding: 0 14px; }
    .guide-hero h1 { font-size: 1.4rem; }
    .guide-hero p { font-size: 0.9rem; }
    .guide-hero-actions { flex-direction: column; align-items: stretch; }
    .guide-section h1 { font-size: 1.35rem; }
    .guide-section h2 { font-size: 1.05rem; }
    .guide-section ol.steps > li { padding-left: 46px; font-size: 0.88rem; }
}

/* Print ------------------------------------------------------------ */

@media print {
    .guide-sidebar, .guide-toc-trigger, .guide-totop, .guide-hero-actions,
    header, .header, .mobile-drawer, .guide-overlay { display: none !important; }
    .guide-layout { grid-template-columns: 1fr; }
    .guide-section {
        background: none;
        border: none;
        page-break-inside: avoid;
        padding: 0 0 20px;
        border-bottom: 1px solid #999;
    }
    .guide-section h1, .guide-section h2 { color: #000; }
    .guide-section p, .guide-section li { color: #222; }
    .callout { background: #f3f3f3 !important; color: #000 !important; }
    .anchor-link { display: none; }
}
