/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.url-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.url-input-row .text-input {
    flex: 1;
    min-width: 0;
}

.text-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-input::placeholder {
    color: #6b7280;
}

.textarea-input {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', monospace;
    outline: none;
    resize: vertical;
    min-height: 120px;
    width: 100%;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.textarea-input::placeholder {
    color: #6b7280;
}

.paste-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.paste-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.paste-area label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.disclaimer-text {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.modal-hidden {
    display: none;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    white-space: nowrap;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    white-space: nowrap;
}

.button-text {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 150ms ease;
    text-align: left;
}

.button-text:hover {
    color: #60a5fa;
}

.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #9ca3af;
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.section-header .section-title {
    margin-bottom: 0;
}

.section-desc {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.score-gauge {
    position: relative;
    width: 160px;
    height: 160px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-bg {
    stroke: #1a1a1a;
}

.gauge-fill {
    stroke: #3b82f6;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease, stroke 0.5s ease;
}

.gauge-fill.score-fast {
    stroke: #22c55e;
}

.gauge-fill.score-moderate {
    stroke: #f97316;
}

.gauge-fill.score-slow {
    stroke: #ef4444;
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
}

.score-label {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-label.score-fast {
    color: #22c55e;
}

.score-label.score-moderate {
    color: #f97316;
}

.score-label.score-slow {
    color: #ef4444;
}

.score-url {
    font-size: 14px;
    color: #6b7280;
    word-break: break-all;
    text-align: center;
    max-width: 100%;
}

.vitals-section {
    display: flex;
    flex-direction: column;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.vital-card {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 150ms ease;
}

.vital-card.rating-good {
    border-color: #22c55e;
}

.vital-card.rating-needs-improvement {
    border-color: #f97316;
}

.vital-card.rating-poor {
    border-color: #ef4444;
}

.vital-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.vital-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.vital-value {
    font-size: 20px;
    font-weight: 700;
    color: #e5e7eb;
}

.vital-rating {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.vital-rating.rating-good {
    color: #22c55e;
}

.vital-rating.rating-needs-improvement {
    color: #f97316;
}

.vital-rating.rating-poor {
    color: #ef4444;
}

.resource-stats-section {
    display: flex;
    flex-direction: column;
}

.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.stats-bar .stat-item {
    flex: 1 1 calc(25% - 12px);
    min-width: 100px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
}

.category-scores-section {
    display: flex;
    flex-direction: column;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-name {
    font-size: 14px;
    font-weight: 400;
    color: #e5e7eb;
    width: 200px;
    flex-shrink: 0;
}

.category-bar-track {
    flex: 1;
    height: 6px;
    background-color: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease, background-color 0.5s ease;
    background-color: #3b82f6;
}

.category-bar-fill.score-fast {
    background-color: #22c55e;
}

.category-bar-fill.score-moderate {
}

.category-bar-fill.score-slow {
    background-color: #ef4444;
}

.category-score {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.waterfall-section {
    display: flex;
    flex-direction: column;
}

.waterfall-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 12px;
    font-weight: 500;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-js::before {
    background-color: #eab308;
}

.legend-css::before {
    background-color: #3b82f6;
}

.legend-images::before {
    background-color: #22c55e;
}

.legend-fonts::before {
    background-color: #a855f7;
}

.waterfall-container {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.waterfall-container canvas {
    width: 100%;
}

.suggestions-section {
    display: flex;
    flex-direction: column;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
    border-left: 3px solid #374151;
}

.suggestion-item.severity-high {
    border-left-color: #ef4444;
}

.suggestion-item.severity-medium {
    border-left-color: #f97316;
}

.suggestion-item.severity-low {
    border-left-color: #3b82f6;
}

.suggestion-severity {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
}

.suggestion-severity.severity-high {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.suggestion-severity.severity-medium {
    background-color: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.suggestion-severity.severity-low {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.suggestion-body {
    flex: 1;
    min-width: 0;
}

.suggestion-message {
    font-size: 14px;
    color: #e5e7eb;
    line-height: 1.4;
}

.suggestion-count {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.pro-feature {
    position: relative;
    opacity: 0.6;
}

.pro-feature.unlocked {
    opacity: 1;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.batch-section {
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-input-row {
    display: flex;
    gap: 8px;
}

.batch-input-row .text-input {
    flex: 1;
    min-width: 0;
}

.batch-url-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-url-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.batch-url-item-text {
    font-size: 13px;
    color: #e5e7eb;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.batch-url-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 150ms ease;
}

.batch-url-remove:hover {
    color: #ef4444;
}

.batch-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-progress .progress-bar {
    flex: 1;
    max-width: none;
}

.batch-progress-text {
    font-size: 13px;
    color: #9ca3af;
    flex-shrink: 0;
}

.batch-results {
    border-top: 1px solid #374151;
    padding-top: 16px;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.batch-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    border-bottom: 1px solid #374151;
}

.batch-table td {
    padding: 10px 12px;
    color: #e5e7eb;
    border-bottom: 1px solid #1a1a1a;
}

.batch-table tr:hover td {
    background-color: #1a1a1a;
}

.batch-table .score-cell {
    font-weight: 600;
}

.batch-table .score-cell.score-fast {
    color: #22c55e;
}

.batch-table .score-cell.score-moderate {
    color: #f97316;
}

.batch-table .score-cell.score-slow {
    color: #ef4444;
}

.compare-section {
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compare-input-row {
    display: flex;
    gap: 8px;
}

.compare-input-row .text-input {
    flex: 1;
    min-width: 0;
}

.compare-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid #374151;
    padding-top: 16px;
}

.compare-card {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
}

.compare-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.compare-card-url {
    font-size: 14px;
    color: #e5e7eb;
    font-weight: 500;
    word-break: break-all;
}

.compare-card-score {
    font-size: 24px;
    font-weight: 700;
}

.compare-delta {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.compare-delta.positive {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.compare-delta.negative {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.compare-delta.neutral {
    background-color: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.history-section {
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 150ms ease;
}

.history-item:hover {
    border-color: #3b82f6;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-url {
    font-size: 13px;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.history-item-score {
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 12px;
}

.history-item-score.score-fast {
    color: #22c55e;
}

.history-item-score.score-moderate {
    color: #f97316;
}

.history-item-score.score-slow {
    color: #ef4444;
}

.history-sparkline {
    width: 60px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 12px;
}

.export-section {
    display: flex;
}

.export-section .button-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .output-section {
        padding: 16px;
    }

    .url-input-row {
        flex-direction: column;
    }

    .url-input-row .button-primary,
    .url-input-row .button-secondary {
        width: 100%;
    }

    .stats-bar {
        gap: 8px;
    }

    .stats-bar .stat-item {
        flex: 1 1 calc(50% - 4px);
    }

    .stat-item {
        padding: 10px;
    }

    .stat-value {
        font-size: 14px;
    }

    .category-item {
        flex-wrap: wrap;
    }

    .category-name {
        width: 100%;
    }

    .category-bar-track {
        order: 1;
    }

    .category-score {
        order: 2;
    }

    .score-gauge {
        width: 140px;
        height: 140px;
    }

    .gauge-value {
        font-size: 32px;
    }

    .vitals-grid {
        grid-template-columns: 1fr;
    }

    .batch-input-row,
    .compare-input-row {
        flex-direction: column;
    }

    .batch-table {
        font-size: 12px;
    }

    .batch-table th,
    .batch-table td {
        padding: 6px 8px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .stats-bar .stat-item {
        flex: 1 1 calc(50% - 4px);
    }

    .waterfall-container {
        max-height: 300px;
    }

    .history-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .history-sparkline {
        display: none;
    }
}