/* ========================================
   Page Size Checker - Tool Stylesheet
   Extends: ../style.css (main)
   ======================================== */

/* ========================================
   Layout
   ======================================== */
.psc-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

/* ========================================
   Input Panel
   ======================================== */
.psc-input-panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 88px; /* header height + gap */
}

.psc-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.psc-tab {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.psc-tab:hover {
  color: #333;
  background: #fafafa;
}

.psc-tab.active {
  color: #111;
  border-bottom-color: #111;
  background: #fff;
}

.psc-tab-content {
  display: none;
  padding: 24px;
}

.psc-tab-content.active {
  display: block;
}

/* Single URL Input */
.psc-url-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
  color: #222;
}

.psc-url-input:focus {
  border-color: #888;
}

.psc-url-input::placeholder {
  color: #bbb;
}

.psc-check-btn {
  width: 100%;
  padding: 10px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

.psc-check-btn:hover {
  background: #000;
}

.psc-check-btn:disabled {
  background: #888;
  cursor: not-allowed;
}

/* Upload Area */
.psc-upload-area {
  border: 2px dashed #d0d0d0;
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.psc-upload-area:hover,
.psc-upload-area.drag-over {
  border-color: #888;
  background: #fafafa;
}

.psc-upload-area.has-file {
  border-style: solid;
  border-color: #ccc;
  background: #f8f8f8;
}

.psc-upload-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: #bbb;
}

.psc-upload-icon svg {
  width: 100%;
  height: 100%;
}

.psc-upload-label {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.psc-upload-hint {
  font-size: 12px;
  color: #999;
}

.psc-file-name {
  font-size: 13px;
  color: #333;
  font-weight: 500;
  word-break: break-all;
}

.psc-csv-format {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 14px;
  margin-top: 16px;
}

.psc-csv-format-title {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.psc-csv-code {
  font-family: monospace;
  font-size: 11px;
  color: #555;
  line-height: 1.6;
}

.psc-csv-code .head {
  color: #0066cc;
  font-weight: 600;
}

/* ========================================
   Results Panel
   ======================================== */
.psc-results-panel {
  min-height: 200px;
}

/* Summary Bar */
.psc-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.psc-stat {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.psc-stat-num {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  line-height: 1;
  margin-bottom: 4px;
}

.psc-stat-num.over {
  color: #c62828;
}

.psc-stat-num.warn {
  color: #e65100;
}

.psc-stat-num.ok {
  color: #2e7d32;
}

.psc-stat-label {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

/* Progress Bar (single URL result) */
.psc-single-result {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px;
}

.psc-result-url {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  word-break: break-all;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 4px;
}

.psc-size-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.psc-size-value {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: #111;
}

.psc-size-unit {
  font-size: 18px;
  color: #888;
  font-weight: 400;
}

.psc-size-sub {
  font-size: 13px;
  color: #999;
  margin-bottom: 20px;
}

/* Progress Track */
.psc-progress-track {
  height: 8px;
  background: #f0f0f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.psc-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
  background: #2e7d32;
}

.psc-progress-fill.warn {
  background: #e65100;
}

.psc-progress-fill.over {
  background: #c62828;
}

.psc-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #999;
  margin-bottom: 20px;
}

/* Rating Badge */
.psc-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.psc-rating.ok {
  background: #e8f5e9;
  color: #2e7d32;
}

.psc-rating.warn {
  background: #fff3e0;
  color: #e65100;
}

.psc-rating.over {
  background: #ffebee;
  color: #c62828;
}

.psc-rating svg {
  width: 14px;
  height: 14px;
}

.psc-meta-row {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.psc-meta-item {
  font-size: 12px;
  color: #888;
}

.psc-meta-item strong {
  color: #444;
  font-weight: 600;
}

/* ========================================
   Table (CSV Results)
   ======================================== */
.psc-table-wrap {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

.psc-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  gap: 16px;
  flex-wrap: wrap;
}

.psc-table-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.psc-progress-info {
  font-size: 12px;
  color: #888;
}

.psc-export-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.psc-export-btn:hover {
  background: #f5f5f5;
}

.psc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.psc-table th {
  background: #f8f8f8;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.psc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.psc-table tr:last-child td {
  border-bottom: none;
}

.psc-table tr:hover td {
  background: #fafafa;
}

.psc-url-col {
  font-family: monospace;
  font-size: 11px;
  color: #444;
  word-break: break-all;
  max-width: 300px;
}

.psc-url-col a {
  color: #0066cc;
  text-decoration: none;
}

.psc-url-col a:hover {
  text-decoration: underline;
}

.psc-bar-col {
  min-width: 120px;
}

.psc-mini-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 2px;
}

.psc-mini-fill {
  height: 100%;
  border-radius: 99px;
  background: #2e7d32;
}

.psc-mini-fill.warn {
  background: #e65100;
}
.psc-mini-fill.over {
  background: #c62828;
}

.psc-mini-pct {
  font-size: 10px;
  color: #aaa;
}

.psc-size-col {
  font-weight: 600;
  white-space: nowrap;
  font-size: 12px;
  color: #222;
}

/* Row status pill */
.psc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.psc-pill.ok {
  background: #e8f5e9;
  color: #2e7d32;
}
.psc-pill.warn {
  background: #fff3e0;
  color: #e65100;
}
.psc-pill.over {
  background: #ffebee;
  color: #c62828;
}
.psc-pill.error {
  background: #f5f5f5;
  color: #999;
}

/* Checking skeleton row */
.psc-row-checking td {
  opacity: 0.5;
}

.psc-checking-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: psc-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes psc-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty / Loading States */
.psc-empty {
  text-align: center;
  padding: 64px 32px;
  color: #bbb;
}

.psc-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: block;
  opacity: 0.4;
}

.psc-empty-title {
  font-size: 15px;
  color: #999;
  margin-bottom: 8px;
}

.psc-empty-sub {
  font-size: 13px;
  color: #bbb;
}

/* Loading overlay for single check */
.psc-checking-single {
  text-align: center;
  padding: 48px;
}

.psc-checking-big-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: #222;
  border-radius: 50%;
  animation: psc-spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

.psc-checking-single p {
  font-size: 14px;
  color: #888;
}

/* ========================================
   HTTP Status colors (reuse from parent)
   ======================================== */
.http-2xx {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}
.http-3xx {
  background: #fff8e1;
  color: #e65100;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}
.http-4xx {
  background: #ffebee;
  color: #c62828;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}
.http-5xx {
  background: #fce4ec;
  color: #ad1457;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .psc-layout {
    grid-template-columns: 1fr;
  }

  .psc-input-panel {
    position: static;
  }

  .psc-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .psc-summary {
    grid-template-columns: 1fr 1fr;
  }
}
