/* Enhanced Controls */
.erp-control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.erp-control-group {
    flex: 1;
    min-width: 250px;
}

.erp-control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.erp-input-info {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.erp-char-count-label,
.erp-word-count-label {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.erp-input-options {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.erp-tooltip {
    cursor: help;
    color: #3498db;
}

.erp-vocab-info {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.erp-limits-info {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.erp-limit-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Result Meta */
.erp-result-meta {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.erp-result-style,
.erp-result-level,
.erp-result-length {
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.erp-result-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 10px;
    background: #f0f7ff;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3e50;
}

/* Progress Bar */
.erp-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 20px auto;
    overflow: hidden;
}

.erp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

/* Analysis Modal */
.erp-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.erp-analysis-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.erp-analysis-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.erp-analysis-card p {
    margin: 5px 0;
    font-size: 14px;
}

/* Warning States */
.warning {
    color: #e74c3c !important;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Small text inputs */
.small-text {
    width: 80px !important;
}

.regular-text {
    width: 100% !important;
    max-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .erp-control-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .erp-control-group {
        min-width: 100%;
    }
    
    .erp-limits-info {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
    }
    
    .erp-result-meta,
    .erp-result-stats {
        flex-direction: column;
        gap: 8px;
    }
}


/* Vocabulary Styles */
.erp-vocabulary-note {
    background: #e8f4fc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #3498db;
    font-size: 14px;
    line-height: 1.5;
}

.erp-vocabulary-note strong {
    color: #2c3e50;
}

.vocab-hint {
    font-size: 12px;
    color: #3498db;
    margin-top: 5px;
    font-style: italic;
    animation: fadeIn 0.5s ease;
}

.erp-vocab-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    animation: slideIn 0.3s ease;
}

.erp-vocab-warning strong {
    color: #856404;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Highlight vocabulary in results */
.vocab-highlight {
    background-color: #fff9c4;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    border-bottom: 2px solid #ffd54f;
}

/* Make vocabulary input more prominent */
#custom-vocabulary {
    background: #fffde7;
    border-color: #ffeb3b;
}

#custom-vocabulary:focus {
    background: #fffde7;
    border-color: #fbc02d;
    box-shadow: 0 0 0 3px rgba(255, 235, 59, 0.2);
}

/* Vocabulary Highlighting Styles */
.erp-highlight-btn {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
}

.erp-highlight-btn:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

.erp-highlight-btn.disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Vocabulary highlight in text */
.vocab-highlight {
    background-color: #fff9c4;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    border-bottom: 3px solid #ffd54f;
    box-shadow: 0 2px 4px rgba(255, 213, 79, 0.3);
    position: relative;
    animation: highlightPulse 2s infinite;
}

.vocab-highlight::after {
    content: "★";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #ff9800;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 2px 4px rgba(255, 213, 79, 0.3); }
    50% { box-shadow: 0 2px 8px rgba(255, 213, 79, 0.6); }
    100% { box-shadow: 0 2px 4px rgba(255, 213, 79, 0.3); }
}

/* Vocabulary stats */
.erp-vocab-stats {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    animation: fadeIn 0.5s ease;
}

.erp-vocab-stats strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

.erp-vocab-stats span {
    background: #e8f4fc;
    padding: 4px 10px;
    margin: 0 8px 8px 0;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.erp-vocab-stats span:hover {
    background: #bbdefb;
    transform: translateY(-1px);
}

/* Vocabulary warning */
.erp-vocab-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    animation: slideIn 0.3s ease;
}

.erp-vocab-warning strong {
    color: #856404;
}

.erp-vocab-warning small {
    color: #856404;
    opacity: 0.8;
    font-size: 12px;
}

/* Animation for vocabulary hint */
@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Vocabulary input styling */
#custom-vocabulary {
    background: #fffde7;
    border-color: #ffeb3b;
    transition: all 0.3s ease;
}

#custom-vocabulary:focus {
    background: #fffde7;
    border-color: #fbc02d;
    box-shadow: 0 0 0 3px rgba(255, 235, 59, 0.2);
}

.vocab-hint {
    font-size: 12px;
    color: #3498db;
    margin-top: 8px;
    font-style: italic;
    animation: fadeIn 0.5s ease;
}

/* Make result actions wrap nicely on mobile */
@media (max-width: 768px) {
    .erp-result-actions {
        flex-direction: column;
    }
    
    .erp-highlight-btn,
    .erp-copy-btn,
    .erp-download-btn,
    .erp-analyze-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}


/* Ensure highlight button is visible */
.erp-highlight-btn {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin: 5px !important;
    min-width: 160px !important;
}

.erp-highlight-btn:hover {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a) !important;
    transform: translateY(-2px) !important;
}

/* Debug styles - make elements obvious */
.debug-border {
    border: 2px solid red !important;
}

/* Make sure result container shows */
#erp-result-container {
    display: none;
}

#erp-result-container:not([style*="display: none"]) {
    display: block !important;
}


/* Language & Math Styles */
.erp-lang-label {
    background: #e8f4fc;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.erp-math-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.erp-math-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.erp-math-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin: 5px;
    min-width: 160px;
}

.erp-math-btn:hover {
    background: linear-gradient(135deg, #f57c00, #e65100);
    transform: translateY(-2px);
}

/* Math highlighting */
.math-highlight {
    background-color: #e1f5fe;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    border-left: 3px solid #03a9f4;
    animation: mathPulse 2s infinite;
}

@keyframes mathPulse {
    0% { background-color: #e1f5fe; }
    50% { background-color: #b3e5fc; }
    100% { background-color: #e1f5fe; }
}

/* Language flags in dropdown */
#input-language option,
#output-language option {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><circle cx="10" cy="10" r="8" fill="%23f0f0f0"/></svg>');
    background-repeat: no-repeat;
    background-position: left 5px center;
    padding-left: 30px;
}

#input-language option[value="en"],
#output-language option[value="en"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="20" height="20" fill="%2300287c"/><rect x="2" y="2" width="16" height="16" fill="%23cf142b"/><rect x="8" y="2" width="4" height="16" fill="white"/><rect x="2" y="8" width="16" height="4" fill="white"/></svg>');
}

#input-language option[value="zh"],
#output-language option[value="zh"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="20" height="20" fill="%23de2910"/><circle cx="10" cy="10" r="6" fill="%23ffde00"/></svg>');
}

/* Math preview styling */
.erp-math-preview code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d32f2f;
}

.erp-result-language {
    background: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid #4caf50;
}



