/* 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;
}

.text-area {
    background-color: #141414;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    min-height: 200px;
    transition: border-color 150ms ease;
}

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

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

.live-counter {
    font-size: 13px;
    color: #6b7280;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.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;
}

.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;
}

.compare-toggle-row {
    display: flex;
}

.compare-toggle-row .button-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-section .setting-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-section .setting-content > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.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;
}

.modal-hidden {
    display: none;
}

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

.grade-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
}

.grade-badge {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    background-color: #374151;
    flex-shrink: 0;
    transition: background-color 300ms ease;
}

.grade-badge.grade-a {
    background-color: #22c55e;
}

.grade-badge.grade-b {
    background-color: #3b82f6;
}

.grade-badge.grade-c {
    background-color: #eab308;
    color: #0a0a0a;
}

.grade-badge.grade-d {
    color: #0a0a0a;
}

.grade-badge.grade-f {
    background-color: #ef4444;
}

.grade-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reading-level {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.audience-label {
    font-size: 15px;
    color: #9ca3af;
}

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

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

.score-card:hover {
    border-color: #4b5563;
}

.score-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.score-name {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}

.score-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.score-gauge {
    width: 100%;
}

.gauge-track {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

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

.gauge-fill.gauge-green {
    background-color: #22c55e;
}

.gauge-fill.gauge-blue {
    background-color: #3b82f6;
}

.gauge-fill.gauge-yellow {
    background-color: #eab308;
}

.gauge-fill.gauge-orange {
}

.gauge-fill.gauge-red {
    background-color: #ef4444;
}

.score-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

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

.stats-bar .stat-item {
    flex: 1 1 calc(33.333% - 8px);
    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;
}

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

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #d1d5db;
}

.sentence-breakdown {
    border-top: 1px solid #374151;
    padding-top: 24px;
}

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

.sentence-item {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: #e5e7eb;
    cursor: pointer;
    transition: opacity 150ms ease;
    border-left: 3px solid transparent;
}

.sentence-item:hover {
    opacity: 0.85;
}

.sentence-item.difficulty-easy {
    background-color: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
}

.sentence-item.difficulty-moderate {
    background-color: rgba(234, 179, 8, 0.1);
    border-left-color: #eab308;
}

.sentence-item.difficulty-hard {
    background-color: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.sentence-metrics {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.sentence-metrics span {
    white-space: nowrap;
}

.suggestions-panel {
    border-top: 1px solid #374151;
    padding-top: 24px;
}

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

.suggestion-item {
    padding: 12px 16px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    font-size: 14px;
    color: #e5e7eb;
    line-height: 1.5;
}

.suggestion-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f97316;
    margin-bottom: 4px;
}

.suggestion-text {
    color: #9ca3af;
}

.comparison-results {
    border-top: 1px solid #374151;
    padding-top: 24px;
}

.comparison-block {
    margin-bottom: 20px;
}

.comparison-label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    margin-bottom: 12px;
}

.comparison-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.comparison-score-item {
    padding: 10px 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comparison-score-name {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.comparison-score-value {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
}

.comparison-deltas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #374151;
}

.delta-item {
    padding: 8px 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delta-positive {
    color: #22c55e;
}

.delta-negative {
    color: #ef4444;
}

.delta-neutral {
    color: #6b7280;
}

.export-section {
    display: flex;
}

.export-section .button-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-panel {
    border-top: 1px solid #374151;
    padding-top: 24px;
}

.history-header {
    cursor: pointer;
}

.history-collapse-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    transition: transform 150ms ease, color 150ms ease;
}

.history-collapse-btn:hover {
    color: #e5e7eb;
}

.history-collapse-btn.collapsed {
    transform: rotate(-90deg);
}

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

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

.history-item:hover {
    border-color: #4b5563;
}

.history-grade {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.history-grade.grade-a { background-color: #22c55e; }

.history-grade.grade-b { background-color: #3b82f6; }

.history-grade.grade-c { background-color: #eab308; color: #0a0a0a; }


.history-grade.grade-f { background-color: #ef4444; }

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

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

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

.analyze-loading {
    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;
}

.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;
}

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

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
}

@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;
    }

    .grade-badge {
        width: 64px;
        height: 64px;
        font-size: 32px;
        border-radius: 12px;
    }

    .reading-level {
        font-size: 17px;
    }

    .audience-label {
        font-size: 14px;
    }

    .score-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .score-value {
        font-size: 22px;
    }

    .stats-bar {
        gap: 8px;
    }

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

    .stat-item {
        padding: 10px;
    }

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

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

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

        padding: 0 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

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

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

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

    .grade-display {
        flex-direction: column;
        text-align: center;
    }

    .grade-info {
        align-items: center;
    }

    .comparison-scores {
        grid-template-columns: 1fr;
    }
}