/* ============================================================
   serp-preview / style.css
   Prefix: sp-
   ============================================================ */

.sp-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Section Cards --- */
.sp-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border: 1px solid #eee;
    margin-bottom: 16px;
}

.sp-section-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a73e8;
}

/* --- Form fields --- */
.sp-field-row {
    margin-bottom: 12px;
}

.sp-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    margin-bottom: 5px;
}

.sp-input {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    padding: 9px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    color: #222;
    background: #fff;
}

.sp-input:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.sp-textarea {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    padding: 9px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    color: #222;
    background: #fff;
    height: 80px;
    resize: vertical;
    line-height: 1.6;
}

.sp-textarea:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

/* --- Indicators --- */
.sp-indicator-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

.sp-indicator-label {
    font-weight: 700;
    color: #444;
    min-width: 90px;
    white-space: nowrap;
}

.sp-indicator-value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #1a73e8;
}

.sp-indicator-status {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.sp-status-ok {
    background: #e6f4ea;
    color: #137333;
}

.sp-status-warn {
    background: #fef7e0;
    color: #8a5000;
}

.sp-status-over {
    background: #fce8e6;
    color: #c5221f;
}

.sp-indicator-bar-wrap {
    flex: 1;
    min-width: 120px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.sp-indicator-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.2s, background 0.2s;
    background: #34a853;
}

.sp-indicator-bar.warn {
    background: #fbbc04;
}

.sp-indicator-bar.over {
    background: #ea4335;
}

/* --- PC/Mobile Tabs --- */
.sp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e8eaed;
    margin-bottom: 20px;
}

.sp-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}

.sp-tab:hover {
    color: #1a73e8;
}

.sp-tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.sp-panel {
    display: none;
}

.sp-panel.active {
    display: block;
}

/* --- SERP Card common --- */
.sp-serp-outer {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e8eaed;
}

.sp-serp-card {
    font-family: arial, sans-serif;
    background: #fff;
    padding: 0;
}

/* Breadcrumb / site info row */
.sp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #202124;
    line-height: 1.4;
    margin-bottom: 3px;
    overflow: hidden;
}

.sp-favicon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    color: #888;
}

.sp-breadcrumb-domain {
    color: #202124;
    font-weight: 400;
}

.sp-breadcrumb-path {
    color: #70757a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Site name row */
.sp-sitename-row {
    font-size: 12px;
    color: #70757a;
    line-height: 1.4;
    margin-bottom: 2px;
}

/* Title */
.sp-title-line {
    font-size: 20px;
    line-height: 1.3;
    color: #1a0dab;
    margin-bottom: 4px;
    cursor: pointer;
    word-break: break-word;
    overflow: hidden;
}

.sp-title-line:hover {
    text-decoration: underline;
}

.sp-title-truncated-notice {
    font-size: 11px;
    color: #ea4335;
    margin-bottom: 4px;
    display: none;
}

.sp-title-truncated-notice.visible {
    display: block;
}

/* Description */
.sp-desc-line {
    font-size: 14px;
    line-height: 1.58;
    color: #4d5156;
    overflow: hidden;
    word-break: break-word;
}

/* --- PC specific --- */
.sp-serp-pc .sp-serp-card {
    max-width: 600px;
}

.sp-serp-pc .sp-title-line {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sp-serp-pc .sp-desc-line {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* --- Mobile specific --- */
.sp-serp-sp {
    max-width: 400px;
}

.sp-serp-sp .sp-serp-card {
    max-width: 360px;
}

.sp-serp-sp .sp-title-line {
    font-size: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
}

.sp-serp-sp .sp-breadcrumb {
    font-size: 12px;
}

.sp-serp-sp .sp-desc-line {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* --- Bulk check --- */
.sp-bulk-textarea {
    width: 100%;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    padding: 10px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    height: 100px;
    resize: vertical;
    color: #222;
    background: #fff;
    line-height: 1.5;
}

.sp-bulk-textarea:focus {
    border-color: #1a73e8;
    outline: none;
}

.sp-bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 10px;
}

.sp-bulk-btn:hover {
    background: #1557b0;
}

.sp-bulk-result {
    margin-top: 14px;
    overflow-x: auto;
}

.sp-bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 500px;
}

.sp-bulk-table th {
    background: #f0f6ff;
    padding: 7px 10px;
    text-align: left;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #d0e4ff;
    white-space: nowrap;
}

.sp-bulk-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    vertical-align: middle;
}

.sp-bulk-table tr:last-child td {
    border-bottom: none;
}

.sp-bulk-table .cell-trunc {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .sp-tabs {
        gap: 0;
    }

    .sp-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .sp-indicator {
        flex-wrap: wrap;
    }

    .sp-indicator-bar-wrap {
        min-width: 80px;
    }
}