/* ============================================================
   Street View 360 Downloader — CSS v5.0 (V43 style)
   ============================================================ */

/* ── Reset & Base ── */
.sv360-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 0 40px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    color: #333;
    box-sizing: border-box;
}
.sv360-wrap *,
.sv360-wrap *::before,
.sv360-wrap *::after {
    box-sizing: inherit;
}

/* iOS Safari zooms the whole page in when a focused form control has a
   computed font-size under 16px, and (per user report) can leave the page
   in a zoomed-in state afterwards. Force 16px on every text-like control,
   unconditionally (not just under a mobile media query), to prevent that
   auto-zoom from ever triggering. Checkboxes/radios are excluded since
   their on-screen size isn't text-driven. */
.sv360-wrap input:not([type="checkbox"]):not([type="radio"]),
.sv360-wrap select,
.sv360-wrap textarea {
    font-size: 16px !important;
}

/* ── Page Header ── */
.sv360-page-header {
    padding: 20px 0 8px;
}
.sv360-page-header h1,
.sv360-frontend-title {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #310062;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}
/* WP admin already has h1 styles — override for our page */
.sv360-wrap .sv360-page-header h1 {
    font-size: 1.8rem !important;
}
.sv360-subtitle {
    color: #666;
    margin: 0 0 12px;
    font-size: 16px;
}

/* ── Donate Banner ── */
.sv360-donate-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: snow;
    font-size: 15px;
    font-weight: 400;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 10px 14px;
    width: 100%;
    margin: 10px 0 16px;
    font-family: Arial, sans-serif;
    color: #333;
    text-align: center;
}

/* ── Tool Box ── */
.sv360-tool-box {
    background: #fff;
    border: 3px solid #dc3545;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ── Labels ── */
.sv360-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: #333;
}

/* ── Textarea ── */
.sv360-input-section {
    margin-bottom: 18px;
}
.sv360-textarea-wrap {
    position: relative;
}
#sv360-pano-input {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 10px 40px 10px 10px;
    transition: border-color .2s;
    min-height: 90px;
}
#sv360-pano-input:focus {
    outline: none;
    border-color: gray;
}
.sv360-clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
    font-size: 13px;
    padding: 0;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.sv360-clear-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    transform: scale(1.08);
}
.sv360-clear-btn:active { transform: scale(.95); }

.sv360-hint {
    font-size: 13px;
    color: #888;
    margin: 4px 0 0;
}

/* ── Settings Row ── */
.sv360-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.sv360-setting-group {
    flex: 1 1 160px;
    min-width: 140px;
}
.sv360-setting-group select,
.sv360-setting-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #333;
    transition: border-color .2s;
    appearance: auto;
}
.sv360-setting-group select:focus,
.sv360-setting-group input[type="number"]:focus {
    outline: none;
    border-color: #dc3545;
}
.sv360-options-group { flex: 1 1 200px; }
.sv360-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 6px;
    color: #333;
}
.sv360-checkbox-label input[type="checkbox"] { margin: 0; }

/* "Support 360° on Facebook post" locked/unsupported state (PNG & WebP
   output): rendered as a disabled, red cross rather than a normal checkbox
   to make clear this option can't actually be enabled for these formats. */
.sv360-checkbox-label input[type="checkbox"].sv360-fb-unsupported {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid #dc3545;
    border-radius: 3px;
    background: #fff8f8;
    position: relative;
    cursor: not-allowed;
    flex-shrink: 0;
}
.sv360-checkbox-label input[type="checkbox"].sv360-fb-unsupported::after {
    content: "\2715";
    position: absolute;
    top: -4px;
    left: 0;
    width: 14px;
    text-align: center;
    color: #dc3545;
    font-size: 13px;
    font-weight: bold;
    line-height: 14px;
}
.sv360-checkbox-label:has(input.sv360-fb-unsupported) { cursor: not-allowed; }

/* ── Action Buttons ── */
.sv360-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.sv360-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc3545;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background .15s, transform .1s;
}
.sv360-btn-primary:hover { background: #c82333; transform: translateY(-1px); }
.sv360-btn-primary:active { transform: translateY(0); }
.sv360-btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.sv360-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #6c757d;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background .15s;
}
.sv360-btn-secondary:hover { background: #5a6268; }

/* ── Section Boxes ── */
.sv360-section-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.sv360-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #310062;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ── Progress Bar ── */
.sv360-progress-bar-wrap {
    background: #f0f0f0;
    border-radius: 8px;
    height: 22px;
    overflow: hidden;
    margin-bottom: 10px;
}
.sv360-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #dc3545, #e87c26);
    border-radius: 8px;
    transition: width .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 28px;
}
.sv360-progress-text {
    color: #555;
    font-size: 13px;
    margin-bottom: 12px;
}
#sv360-pano-list {
    max-width: 100%;
    overflow-x: hidden;
}

/* Pano list items
   NOTE: flex items default to `min-width: auto`, meaning a long unbroken
   string (a monospace URL/pano-id) refuses to shrink below its own
   intrinsic width and instead pushes the row wider than its container —
   the row (and the "Regular photo... — ready" message) then overflows off
   the right edge. Regular mobile browsers hide this by letting the whole
   page pan/zoom horizontally, so it isn't obvious there; a WebView with
   useWideViewPort/loadWithOverviewMode locks its scale on initial page
   load and won't rescale for content added later by AJAX, so the
   overflow just runs past the visible edge. Fix at the source: let the
   row wrap and let its text break, instead of overflowing. */
.sv360-pano-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 12px;
    min-width: 0;
    max-width: 100%;
}
.sv360-pano-id {
    font-family: monospace;
    color: #333;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-all;
}
.sv360-pano-msg {
    color: #777;
    font-style: italic;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-all;
}
.sv360-pano-status {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sv360-status-pending     { background: #ccc; }
.sv360-status-downloading { background: #dc3545; animation: sv360-pulse 1s infinite; }
.sv360-status-stitching   { background: #f0a500; animation: sv360-pulse 1s infinite; }
.sv360-status-done        { background: #28a745; }
.sv360-status-error       { background: #dc3232; }
.sv360-status-aborted     { background: #999; }
.sv360-status-skipped     { background: #999; }

@keyframes sv360-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

/* ── "Processing URL(s)..." spinner overlay (style matches Plugin V43) ── */
@keyframes sv360-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
#sv360-spinner-overlay {
    display: flex;
    align-items: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    background: rgba(255, 255, 255, 0.97);
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    z-index: 999999;
    gap: 12px;
    font-family: Arial, sans-serif;
    opacity: 1;
    transition: opacity .25s ease;
}
#sv360-spinner-overlay.sv360-spinner-hide {
    opacity: 0;
}
#sv360-spinner-overlay .sv360-spin-circle {
    width: 22px;
    height: 22px;
    border: 4px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: sv360-spin 1s linear infinite;
    flex-shrink: 0;
}

/* Grouped skip/success summary lines below the pano list — plain list,
   just enough spacing to not run into the list above it. */
.sv360-summary-list {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: #555;
}

/* ── Results Grid ── */
.sv360-results-hint {
    align-items: flex-start;
    gap: 8px;
    color: #7a5b00;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin: 16px 0 16px;
}
.sv360-results-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.sv360-result-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
    transition: box-shadow .2s;
    width: 100%;
}
.sv360-result-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.sv360-result-thumb {
    width: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sv360-result-thumb img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.sv360-result-info { padding: 14px 16px; }
.sv360-result-filename {
    font-weight: 700;
    font-size: 13px;
    word-break: break-all;
    margin: 0 0 4px;
    color: #333;
}
.sv360-result-meta { font-size: 12px; color: #777; margin: 2px 0; }
.sv360-result-links { margin-top: 10px; display: flex; gap: 10px; }
.sv360-btn-download-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #28a745;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background .15s, transform .1s;
    box-shadow: 0 2px 6px rgba(40,167,69,.35);
}
.sv360-btn-download-result:hover { background: #218838; transform: translateY(-1px); }
.sv360-btn-download-result:active { transform: translateY(0); }

/* ── 360° Panorama Viewer ── */
.sv360-result-thumb-clickable {
    cursor: pointer;
    position: relative;
}
.sv360-result-thumb-clickable::after {
    content: "\26F6  View 360\00b0";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}
.sv360-result-thumb-clickable:hover::after { opacity: 1; }
.sv360-btn-view360 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc3545;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background .15s, transform .1s;
    box-shadow: 0 2px 6px rgba(220,53,69,.35);
}
.sv360-btn-view360:hover { background: #c82333; transform: translateY(-1px); }
.sv360-btn-view360:active { transform: translateY(0); }

.sv360-pano-modal {
    /* inset: 0 (i.e. left/top/right/bottom: 0) is the fallback, based on
       the layout viewport. When window.visualViewport is available, JS
       (openPanoramaViewer / updateModalViewportPosition) overrides
       left/top/width/height inline so the modal instead tracks the true
       visible area — see admin.js for why this matters. */
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.94);
    z-index: 999999;
}
.sv360-pano-viewer {
    width: 100%;
    height: 100%;
}
.sv360-pano-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.sv360-pano-modal-close:hover { background: rgba(0,0,0,.8); }

/* ── How-To Box ── */
.sv360-howto-box { background: #f9f9f9; }
.sv360-howto-list { margin: 0; padding-left: 20px; }
.sv360-howto-list li {
    margin-bottom: 7px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}
.sv360-howto-list code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* ============================================================
   SEO SECTION — same as V43 / downloadyoutubesubtitles.com
   ============================================================ */

#gic-seo-section {
    max-width: 1320px !important;
    width: 100% !important;
    margin: 20px auto 0 !important;
    box-sizing: border-box;
    padding: 24px !important;
    border: 3px solid #ccc;
    box-shadow: 0 0 10px #f4efe7;
    border-radius: 10px;
    background-color: #FFF;
    font-family: Arial, sans-serif !important;
    font-size: 18px !important;
    line-height: 1.42857143 !important;
    color: #333;
}

#gic-seo-section h1 {
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-weight: bold !important;
    letter-spacing: -0.02em;
    color: #310062;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    font-size: 2.8rem !important;
}

#gic-seo-section h2 {
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-weight: bold !important;
    letter-spacing: -0.02em;
    color: #310062;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    font-size: 1.75rem !important;
}

#gic-seo-section h2.gic-faq-title {
    color: #00778a !important;
    font-size: 3rem !important;
    font-weight: normal !important;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

#gic-seo-section h3 {
    font-family: Arial, sans-serif !important;
    font-size: inherit !important;
    font-weight: bold !important;
    line-height: inherit;
    margin: 20px 0 6px;
    color: #333;
}

#gic-seo-section p {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.42857143;
    color: #333;
}

#gic-seo-section pre {
    margin: 0 0 16px;
}

#gic-seo-section ul.gic-article-list {
    padding-left: 25px;
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.42857143;
    color: #333;
}
#gic-seo-section ul.gic-article-list li { margin-bottom: 4px; }

#gic-seo-section ol.gic-article-list {
    padding-left: 25px;
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.42857143;
    color: #333;
}
#gic-seo-section ol.gic-article-list li { margin-bottom: 4px; }

/* ── 2-col grid ── */
.gic-row { display: grid; gap: 24px; align-items: start; margin-bottom: 0; }
.gic-row-2col { grid-template-columns: 1fr 1fr; }
.gic-col-img img { width: 100%; height: auto; display: block; }

/* ── CTA button ── */
.gic-btn-danger {
    display: inline-block;
    padding: 10px 20px;
    background-color: #dc3545;
    color: #fff !important;
    border: 1px solid #dc3545;
    border-radius: 4px;
    font-size: 1.5rem !important;
    font-weight: 400;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1.5;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out;
    font-family: Arial, sans-serif !important;
}
.gic-btn-danger:hover,
.gic-btn-danger:focus {
    background-color: #c82333;
    border-color: #bd2130;
    color: #fff !important;
    text-decoration: none !important;
}

/* ── FAQ Accordion (V43 clone) ── */
#gic-faq-accordion { margin-top: 0; }

.gic-accordion-item {
    border: 1px solid #ddd;
    border-radius: 0;
    margin-bottom: 1.5rem !important;
    overflow: hidden;
    background-color: #fff;
}

.gic-accordion-header,
#gic-seo-section h3.gic-accordion-header {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.gic-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.5rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400;
    color: #212529;
    background-color: #fff;
    border: 0;
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    line-height: 22px;
    transition: color .15s ease-in-out, background-color .15s ease-in-out;
    box-shadow: none;
}
.gic-accordion-btn:hover { background-color: #f8f8f8; color: #212529; }
.gic-accordion-btn:focus,
.gic-accordion-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    background-color: #fff !important;
    color: #212529 !important;
}
.gic-accordion-btn.gic-open:focus,
.gic-accordion-btn.gic-open:focus-visible {
    background-color: #e7f1ff !important;
    color: #0c63e4 !important;
}

.gic-accordion-btn::after {
    content: "";
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    transition: transform .2s ease-in-out;
}
.gic-accordion-btn.gic-open::after {
    transform: rotate(-180deg);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230c63e4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.gic-accordion-btn.gic-open {
    color: #0c63e4;
    background-color: #e7f1ff;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

.gic-accordion-collapse { display: none; border-top: 1px solid rgba(0,0,0,.125); }
.gic-accordion-collapse.gic-show { display: block; }

.gic-accordion-body {
    padding: 1rem 1.25rem;
    font-size: 18px;
    line-height: 1.42857143;
    color: #333;
    font-family: Arial, sans-serif !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .sv360-tool-box { padding: 16px; }
    .sv360-section-box { padding: 16px; }
    .sv360-settings-row { gap: 12px; }
    .sv360-setting-group { flex: 1 1 140px; }
    .sv360-btn-primary { width: 100%; justify-content: center; }
    .sv360-actions { flex-direction: column; }
    .sv360-btn-secondary { width: 100%; justify-content: center; }
}

/* Mobile (≤575px) */
@media (max-width: 575.98px) {
    .sv360-wrap { padding: 0 0 24px; }
    .sv360-tool-box { padding: 12px; border-radius: 8px; }
    .sv360-section-box { padding: 12px; }
    .sv360-settings-row { flex-direction: column; gap: 10px; }
    .sv360-setting-group { flex: none; width: 100%; min-width: 0; }

    /* SEO section mobile */
    #gic-seo-section {
        width: auto !important;
        padding: 16px 10px !important;
    }
    #gic-seo-section h1 { font-size: 2rem !important; }
    #gic-seo-section h2 { font-size: 25px !important; }
    #gic-seo-section h2.gic-faq-title { font-size: 2.5rem !important; }
    .gic-row-2col { grid-template-columns: 1fr !important; }
    .gic-btn-danger { font-size: 1rem !important; }
    .gic-accordion-btn { font-size: 1rem !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    #gic-seo-section h1 { font-size: 2rem !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    #gic-seo-section h1 { font-size: 2.5rem !important; }
}
@media (min-width: 1200px) {
    #gic-seo-section h1 { font-size: 2.8rem !important; }
}
