/* ============================================
   Tripino SaaS — Editor Styles
   Nature theme matching landing page
   ============================================ */

:root {
    --aq-green: #22c55e;
    --aq-green-dark: #16a34a;
    --aq-green-deep: #15803d;
    --aq-green-light: #dcfce7;
    --aq-green-pale: #f0fdf4;
    --aq-forest: #1a3a2a;
    --aq-orange: #f97316;
    --aq-orange-dark: #ea580c;
    --aq-orange-light: #fff7ed;
    --aq-sand: #fafaf9;
    --aq-stone: #57534e;
    --aq-stone-light: #78716c;
    --aq-border: #d6d3d1;
    --aq-border-light: #e7e5e4;
}

.tripsaas-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1c1917;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--aq-green-pale) 0%, #fff 40%, var(--aq-sand) 100%);
}

/* Steps */
.tripsaas-step { display: none; }
.tripsaas-step.tripsaas-active { display: block; animation: tripsaas-fadeIn .4s ease; }

@keyframes tripsaas-fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.tripsaas-header {
    text-align: center;
    margin-bottom: 24px;
}
.tripsaas-header h1,
.tripsaas-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: var(--aq-forest);
}
.tripsaas-subtitle {
    color: var(--aq-stone);
    font-size: 15px;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Step indicator */
.tripsaas-step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.tripsaas-step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--aq-border-light);
    transition: background .3s;
}
.tripsaas-step-dot.active { background: var(--aq-green); }

/* Search bar */
.tripsaas-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.tripsaas-search-bar input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid var(--aq-border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.tripsaas-search-bar input:focus {
    border-color: var(--aq-green);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* Buttons */
.tripsaas-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: var(--aq-green-dark);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(22,163,74,.2);
}
.tripsaas-btn:hover { background: var(--aq-green-deep); box-shadow: 0 4px 12px rgba(22,163,74,.25); }
.tripsaas-btn:active { transform: scale(0.98); }
.tripsaas-btn:disabled { background: var(--aq-border); cursor: not-allowed; box-shadow: none; }

.tripsaas-btn-sm {
    padding: 9px 16px;
    background: #fff;
    color: var(--aq-forest);
    border: 2px solid var(--aq-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.tripsaas-btn-sm:hover { border-color: var(--aq-green); background: var(--aq-green-pale); }

.tripsaas-btn-back {
    padding: 12px 20px;
    background: transparent;
    color: var(--aq-stone);
    border: 2px solid var(--aq-border);
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: all .2s;
}
.tripsaas-btn-back:hover { border-color: var(--aq-forest); color: var(--aq-forest); background: #fff; }

.tripsaas-btn-pay {
    background: var(--aq-orange);
    font-size: 18px;
    padding: 14px 36px;
    box-shadow: 0 2px 12px rgba(249,115,22,.25);
}
.tripsaas-btn-pay:hover { background: var(--aq-orange-dark); box-shadow: 0 4px 16px rgba(249,115,22,.3); }

/* Step actions */
.tripsaas-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

/* Badge */
.tripsaas-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--aq-green-light);
    color: var(--aq-green-deep);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Points list */
.tripsaas-points-list {
    margin-top: 16px;
    max-height: 220px;
    overflow-y: auto;
}
.tripsaas-empty-msg {
    color: #a8a29e;
    text-align: center;
    padding: 28px;
    font-style: italic;
}
.tripsaas-point-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--aq-border-light);
    border-radius: 10px;
    margin-bottom: 6px;
    transition: box-shadow .2s, border-color .2s;
}
.tripsaas-point-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-color: var(--aq-green);
}
.tripsaas-point-num {
    width: 30px; height: 30px;
    background: var(--aq-green-dark); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(22,163,74,.3);
}
.tripsaas-point-name {
    flex: 1;
    font-size: 14px;
}
.tripsaas-point-name input {
    border: none;
    border-bottom: 1px solid var(--aq-border-light);
    padding: 4px 0;
    font-size: 14px;
    width: 100%;
    outline: none;
    background: transparent;
}
.tripsaas-point-name input:focus {
    border-color: var(--aq-green);
}
.tripsaas-point-remove {
    background: none; border: none;
    color: #a8a29e; cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color .2s;
}
.tripsaas-point-remove:hover { color: #ef4444; }

/* Themes grid */
.tripsaas-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.tripsaas-theme-card {
    padding: 24px 16px;
    border: 2px solid var(--aq-border-light);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all .2s;
}
.tripsaas-theme-card:hover {
    border-color: var(--aq-green);
    box-shadow: 0 4px 16px rgba(34,197,94,.12);
    transform: translateY(-2px);
}
.tripsaas-theme-card.tripsaas-selected {
    border-color: var(--aq-green-dark);
    background: var(--aq-green-pale);
    box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}
.tripsaas-theme-icon { font-size: 44px; margin-bottom: 10px; }
.tripsaas-theme-label { font-weight: 600; font-size: 15px; color: var(--aq-forest); }

/* Form */
.tripsaas-form { margin: 16px 0; }
.tripsaas-field {
    margin-bottom: 16px;
}
.tripsaas-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--aq-forest);
}
.tripsaas-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--aq-border);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    background: #fff;
}
.tripsaas-field input:focus {
    border-color: var(--aq-green);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

.tripsaas-free-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--aq-green-light);
    color: var(--aq-green-dark);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* Pricing */
.tripsaas-pricing {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.tripsaas-price-card {
    flex: 1;
    min-width: 100px;
    padding: 18px 12px;
    border: 2px solid var(--aq-border-light);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all .2s;
}
.tripsaas-price-card:hover { border-color: var(--aq-green); }
.tripsaas-price-card.tripsaas-selected {
    border-color: var(--aq-green-dark);
    background: var(--aq-green-pale);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.tripsaas-price-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--aq-forest);
}
.tripsaas-price-unit {
    font-size: 14px; color: var(--aq-stone);
}
.tripsaas-price-desc {
    font-size: 13px; color: var(--aq-stone-light); margin-top: 4px;
}
.tripsaas-pricing-group {
    display: flex; gap: 12px; flex-wrap: wrap; width: 100%;
}
.tripsaas-pricing-divider {
    text-align: center; margin: 20px 0 12px; position: relative; width: 100%;
}
.tripsaas-pricing-divider::before {
    content: ''; position: absolute; top: 50%; left: 0; right: 0;
    height: 1px; background: var(--aq-border-light);
}
.tripsaas-pricing-divider span {
    position: relative; background: var(--aq-green-pale); padding: 2px 14px;
    font-size: 13px; color: var(--aq-green-dark); font-weight: 600;
    border-radius: 12px;
}
.tripsaas-price-business {
    border-color: var(--aq-green-dark);
}
.tripsaas-price-business.tripsaas-selected {
    border-color: var(--aq-green-dark); background: var(--aq-green-pale);
}
.tripsaas-price-extras {
    font-size: 11px; color: var(--aq-green-dark); margin-top: 6px; font-weight: 600;
}

/* Summary */
.tripsaas-summary {
    background: #fff;
    border: 1px solid var(--aq-border-light);
    border-radius: 12px;
    padding: 18px 22px;
    margin: 20px 0;
}
.tripsaas-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 15px;
    border-bottom: 1px solid #f5f5f4;
}
.tripsaas-summary-row:last-child { border-bottom: none; }

/* Success */
.tripsaas-success-card {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--aq-border-light);
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.tripsaas-success-icon { font-size: 72px; margin-bottom: 16px; }
.tripsaas-success-card h2 {
    font-size: 32px; margin: 0 0 8px; color: var(--aq-green-dark);
}
.tripsaas-game-link-box {
    display: flex; gap: 8px;
    margin: 24px auto;
    max-width: 500px;
}
.tripsaas-game-link-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--aq-border);
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    background: var(--aq-sand);
}
.tripsaas-expires {
    color: var(--aq-stone); font-size: 14px;
}

/* Loading */
.tripsaas-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(240,253,244,.95);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}
.tripsaas-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--aq-green-light);
    border-top: 4px solid var(--aq-green-dark);
    border-radius: 50%;
    animation: tripsaas-spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes tripsaas-spin { to { transform: rotate(360deg); } }

.tripsaas-loading p {
    color: var(--aq-forest);
    font-size: 16px;
    font-weight: 600;
}

/* Map marker custom style */
.tripsaas-marker {
    background: var(--aq-green-dark);
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(22,163,74,.35);
}

/* Responsive */
@media (max-width: 600px) {
    .tripsaas-container { padding: 14px; }
    .tripsaas-header h1, .tripsaas-header h2 { font-size: 22px; }
    #tripsaas-map { height: 350px !important; }
    .tripsaas-themes-grid { grid-template-columns: repeat(2, 1fr); }
    .tripsaas-pricing { flex-direction: column; }
    .tripsaas-pricing-group { flex-direction: column; }
    .tripsaas-step-actions { flex-direction: column; }
    .tripsaas-game-link-box { flex-direction: column; }
}

/* 1.4.0 – vlastní úkoly a předvyplnění z výletu */
.tripsaas-preset-note { background: #e6efe3; color: #1f4a27; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.tripsaas-point-task-btn { border: 1px solid #2f6b3a; background: #fff; color: #2f6b3a; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tripsaas-point-task-btn.has-task { background: #2f6b3a; color: #fff; }
.tripsaas-point-start { font-size: 12px; color: #5b6a5e; white-space: nowrap; }
.tripsaas-task-editor { display: grid; gap: 8px; background: #f7f7f2; border-radius: 10px; padding: 12px; margin: -4px 0 10px 38px; font-size: 14px; }
.tripsaas-task-editor[hidden], .tripsaas-task-editor [hidden] { display: none; }
.tripsaas-task-editor label { display: grid; gap: 4px; font-weight: 600; }
.tripsaas-task-editor input[type=text], .tripsaas-task-editor select { width: 100%; padding: 8px 10px; border: 1px solid #d6dccf; border-radius: 8px; font: inherit; font-weight: 400; }
.tripsaas-abcd-opt { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 400 !important; margin-top: 6px; }
.tripsaas-abcd-opt input[type=radio] { flex: none; }

/* Režim odemykání a vlastní texty */
.tripsaas-unlock, .tripsaas-texts { border: 1px solid #e5e5e5; border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; background: #fff; }
.tripsaas-unlock legend, .tripsaas-texts legend { font-weight: 700; padding: 0 6px; }
.tripsaas-unlock label { display: block; margin: 6px 0; cursor: pointer; }
.tripsaas-unlock small, .tripsaas-texts legend small, .tripsaas-field label small { display: block; color: #666; font-weight: 400; margin-left: 22px; }
.tripsaas-field label small { display: inline; margin-left: 4px; }
.tripsaas-texts { margin-top: 16px; }
.tripsaas-texts input, .tripsaas-texts textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font: inherit; }
.tripsaas-print { margin: 18px 0 0; }
.tripsaas-print small { color: #666; }

/* Úprava hotové hry */
.tripsaas-edit-error { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; border-radius:10px; padding:12px 16px; margin:0 0 16px; }
.tripsaas-edit-note { font-size:14px; color:#64748b; margin:8px 0 16px; }
.tripsaas-edit-box { margin-top:16px; font-size:15px; }
.tripsaas-edit-box small, .tripsaas-print-note { color:#64748b; font-size:13px; }
.tripsaas-print-note { background:#fff7ed; border-radius:8px; padding:10px 14px; color:#9a3412; }

/* Obrázek k vlastní otázce */
.tripsaas-task-imgbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.tripsaas-task-imgbox label { flex: 1 1 100%; }
.tripsaas-task-img { max-width: 160px; max-height: 110px; border-radius: 8px; border: 1px solid #e5e5e5; object-fit: cover; }
.tripsaas-task-img[hidden], .tripsaas-task-img-rm[hidden] { display: none; }
.tripsaas-task-img-rm { font-size: 13px; background: none; border: 1px solid #ddd; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.tripsaas-task-img-status { font-size: 13px; color: #b45309; }
.tripsaas-price-cap { font-size: 12px; color: #57534e; margin-top: 4px; }
.tripsaas-pricing-note { font-size: 13px; color: #78716c; margin: 8px 0 0; }

/* ===== Tvorba v terénu (1.11) ===== */
.tripsaas-field-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #f6d3b2; }
.tripsaas-field-cta span { flex: 1 1 240px; font-size: 14px; color: #5b4a3a; }
.tripsaas-field-cta[hidden] { display: none; }
html.tsf-open, html.tsf-open body { overflow: hidden; }
.tsf { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #f6f5f1; color: #1d2a20; font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.tsf[hidden] { display: none; }
.tsf * { box-sizing: border-box; }
.tsf__head { display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; background: #2f6b3a; color: #fff; }
.tsf__head strong { flex: 1; font-size: 17px; }
.tsf__done { border: 0; border-radius: 999px; padding: 8px 16px; background: #fff; color: #2f6b3a; font-weight: 800; cursor: pointer; }
.tsf__x { border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.tsf__map { position: relative; z-index: 0; height: 38vh; min-height: 200px; flex: none; }
.tsf .tripsaas-marker { background: #2f6b3a; }
.tsf__follow { position: absolute; z-index: 500; right: 10px; top: 10px; }
.tsf__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e3e6df; font-weight: 600; font-size: 14px; }
.tsf__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; margin-right: 6px; animation: tsf-blink 1.2s infinite; }
@keyframes tsf-blink { 50% { opacity: .25; } }
.tsf__body { flex: 1; overflow-y: auto; padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); }
.tsf__add { display: block; width: 100%; border: 0; border-radius: 16px; padding: 18px; font-size: 19px; font-weight: 800; color: #fff; background: #e07a2e; box-shadow: 0 6px 18px rgba(224,122,46,.35); cursor: pointer; }
.tsf__add:disabled { opacity: .5; }
.tsf__gps { margin: 8px 0 12px; font-size: 13px; text-align: center; color: #5b6b60; }
.tsf__gps.is-ok { color: #2f6b3a; } .tsf__gps.is-err { color: #b32d2e; }
.tsf__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: tsf; }
.tsf__list li { counter-increment: tsf; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px 10px 46px; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tsf__list li::before { content: counter(tsf); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: #2f6b3a; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.tsf__list li.tsf__empty { padding-left: 12px; color: #5b6b60; } .tsf__list li.tsf__empty::before { display: none; }
.tsf__list li div { flex: 1; min-width: 0; }
.tsf__list li small { display: block; color: #5b6b60; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsf__small { border: 1px solid #c9d3c6; background: #fff; color: #1d2a20; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.tsf__danger { color: #b32d2e; border-color: #f0c2c2; }
.tsf__more { margin: 16px 0 0; background: #fff; border-radius: 12px; padding: 10px 12px; }
.tsf__more summary { font-weight: 700; cursor: pointer; }
.tsf label { display: block; margin: 10px 0 0; font-weight: 600; font-size: 14px; }
.tsf label small { font-weight: 400; color: #5b6b60; }
.tsf input:not([type=radio]):not([type=file]), .tsf textarea, .tsf select { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid #cfd8cc; border-radius: 10px; font: inherit; background: #fff; color: inherit; }
.tsf__tip { font-size: 12px; color: #6b7a6f; margin: 14px 0 0; }
.tsf__sheet { position: absolute; inset: 0; z-index: 1000; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; }
.tsf__sheet[hidden] { display: none; }
.tsf__sheet-in { width: 100%; max-height: 92%; overflow-y: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.tsf__sheet-in h3 { margin: 0 0 4px; font-size: 19px; }
.tsf__label { margin: 10px 0 0; font-weight: 600; font-size: 14px; }
.tsf label.tsf__opt { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.tsf__opt input[type=radio] { width: 22px; height: 22px; flex: none; }
.tsf__opt input:not([type=radio]) { margin-top: 0 !important; }
.tsf__photo input { margin-top: 6px; font-size: 14px; }
.tsf__img { display: block; max-width: 100%; max-height: 200px; border-radius: 10px; margin: 8px 0; }
.tsf__note { color: #5b6b60; font-size: 14px; }
.tsf__sheet-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.tsf__primary { border: 0; border-radius: 999px; padding: 10px 22px; background: #2f6b3a; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.tsf__toast { position: absolute; z-index: 1001; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); background: #1d2a20; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.tsf__toast[hidden] { display: none; }
@media (min-width: 900px) { .tsf { left: auto; width: 480px; box-shadow: -10px 0 40px rgba(0,0,0,.2); } }
