/* Enhanced styles that build on critical CSS */

/* Visibility classes */
.hidden { display: none !important; }
.show { display: block !important; }

/* Interactive elements */
.btn:hover:not(:disabled), .browse-btn:hover { background: #555; }
.btn:active:not(:disabled) { background: #222; }
.toggle-btn:hover:not(.active) { background: #f0f0f0; }
.toggle-btn { transition: background 0.2s; }

/* Drop zone */
.drop-zone { transition: border-color 0.2s; }
.drop-zone.drag-over { border-color: #999; }
.drop-text { margin-bottom: 0.75rem; }

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    text-align: center;
}

/* Layout components */
.file-info, .results, .text-stats {
    background: #f5f5f5;
    padding: 0.75rem;
    border-radius: 4px;
}

.file-info, .action-btn, .text-stats {
    margin-bottom: 0.75rem;
}

.loading {
    text-align: center;
    margin: 0.75rem 0;
}


.progress-container {
    width: 100%;
    max-width: 300px;
    margin: 1rem auto 0;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #f3f3f3;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: #333;
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 3px;
}

.progress-text {
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
}

.results {
    padding: 1rem;
}

.results.error { background: #ffe6e6; }
.result-stats { margin: 0.75rem 0; }
.stat, .text-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}
.text-stat { margin-bottom: 0.25rem; }
.error-message {
    color: #d00;
    margin-top: 1rem;
}

.options {
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

.option-group {
    margin-bottom: 0.75rem;
}

.option-group.inline {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.option-group.inline > div {
    flex: 1;
}

.option-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Form elements */
.option-select, .option-textarea, .text-area {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 1rem;
}

.option-select.narrow {
    width: auto;
    min-width: 120px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}


.checkbox-label {
    cursor: pointer;
    font-weight: 500;
}

.option-note {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.option-textarea, .text-area {
    font-family: monospace;
    font-size: 0.875rem;
    resize: vertical;
}
.option-textarea { min-height: 80px; }
.text-area { min-height: 120px; padding: 0.75rem; }

.toggle-dictionary-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #333;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    width: auto;
}

.toggle-dictionary-btn:hover {
    background: #e9ecef;
    border-color: #999;
}

.toggle-dictionary-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

.custom-dictionary-section {
    margin-top: 0.5rem;
}

.text-container { margin-bottom: 0.75rem; }
.text-label, .option-label, .checkbox-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.checkbox-label { cursor: pointer; }

.text-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.text-btn {
    flex: 1;
    width: auto;
}

.text-stats h4 {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.github-link:hover {
    color: #666;
}

.github-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.help-icon {
    width: 14px;
    height: 14px;
    background: #666;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    transition: background 0.2s;
    flex-shrink: 0;
}

.help-icon:hover {
    background: #333;
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    width: 280px;
    white-space: normal;
    line-height: 1.4;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
}

.help-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}
