/* 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;
    margin-top: 60px;
}

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

.input-options {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
}

label.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 4px;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

label.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

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

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

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

.chart-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 160px;
    padding: 16px;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow-x: auto;
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 24px;
    flex: 1;
    max-width: 36px;
}

.chart-bar {
    width: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 300ms ease, background 150ms ease;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}

.chart-bar-label {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    text-align: center;
}

.chart-bar-wrapper:hover .chart-bar-label {
    color: #e5e7eb;
}

.frequency-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: #9ca3af;
}

.sort-select {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.sort-select:focus {
    border-color: #3b82f6;
}

.sort-select option {
    background-color: #1a1a1a;
    color: #e5e7eb;
}

.frequency-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.frequency-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.frequency-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

.frequency-table tbody tr {
    transition: background-color 150ms ease;
}

.frequency-table tbody tr:nth-child(odd) {
    background-color: #141414;
}

.frequency-table tbody tr:nth-child(even) {
    background-color: #1a1a1a;
}

.frequency-table tbody tr:hover {
    background-color: #222222;
}

.frequency-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    color: #e5e7eb;
}

.col-rank {
    width: 48px;
    text-align: center;
}

.frequency-table tbody td:first-child {
    color: #666;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.col-char {
    width: 100px;
    text-align: center;
}

.frequency-table tbody td:nth-child(2) {
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 15px;
    font-weight: 500;
}

.col-count {
    width: 80px;
    text-align: right;
}

.frequency-table tbody td:nth-child(3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.col-percent {
    width: 72px;
    text-align: right;
}

.frequency-table tbody td:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #3b82f6;
    font-weight: 500;
}

.col-bar {
    width: 150px;
}

.inline-bar {
    height: 8px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px;
    min-width: 2px;
}

.copy-actions {
    display: flex;
    justify-content: flex-start;
}

.pro-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid #374151;
    position: relative;
    opacity: 0.6;
}

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

.pro-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.char-display {
    display: inline-block;
    padding: 2px 8px;
    background-color: #1a1a1a;
    border-radius: 4px;
    min-width: 32px;
}

.char-display.space-char {
    background-color: #374151;
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 200ms ease;
}

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

    .stats-bar {
        gap: 8px;
    }

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

    .stat-item {
        padding: 10px;
    }

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

    .input-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .filter-options {
        flex-direction: column;
        gap: 12px;
    }

    .input-options .button-secondary {
        width: 100%;
    }

    .frequency-table {
        font-size: 13px;
    }

    .frequency-table thead th,
    .frequency-table tbody td {
        padding: 8px 8px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-select {
        flex: 1;
    }

    .chart-container {
        height: 120px;
        padding: 12px;
    }

    .chart-bar-wrapper {
        min-width: 20px;
    }

        padding: 0 16px;
    }

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

    .col-bar {
        display: none;
    }
}

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

    .col-rank {
        width: 36px;
    }

    .col-count {
        width: 60px;
    }

    .col-percent {
        width: 56px;
    }
}