/* Text Converter Styles */
.yan-tools-text-converter {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.yan-tools-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.yan-tools-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.yan-tools-header p {
    margin: 0;
    font-size: 16px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* Main Content */
.yan-tools-main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Section Headers */
.yan-tools-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.yan-tools-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #34495e;
}

.yan-tools-section-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.yan-tools-file-btn,
.yan-tools-clear-btn,
.yan-tools-download-btn,
.yan-tools-copy-btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.yan-tools-file-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.yan-tools-file-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.yan-tools-file-btn:active {
    transform: translateY(0);
}

.yan-tools-clear-btn {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.yan-tools-clear-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.yan-tools-clear-btn:active {
    transform: translateY(0);
}

.yan-tools-download-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.yan-tools-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.yan-tools-download-btn:active {
    transform: translateY(0);
}

.yan-tools-copy-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.yan-tools-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.yan-tools-copy-btn:active {
    transform: translateY(0);
}

/* Textarea Wrapper */
.yan-tools-textarea-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.yan-tools-input-textarea,
.yan-tools-result-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #fafbfc;
}

.yan-tools-input-textarea:focus,
.yan-tools-result-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.yan-tools-result-textarea {
    background: #f8f9fa;
    color: #495057;
}

/* Drag Overlay */
.yan-tools-drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    border: 2px dashed #667eea;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.yan-tools-drag-overlay.drag-over {
    display: flex;
}

.yan-tools-drag-text {
    text-align: center;
    color: #667eea;
}

.yan-tools-upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.yan-tools-drag-text strong {
    display: block;
    font-size: 16px;
}

/* Footer */
.yan-tools-input-footer,
.yan-tools-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.yan-tools-input-stats,
.yan-tools-result-stats {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.yan-tools-input-stats::before {
    content: '📊';
    margin-right: 4px;
    font-size: 16px;
}

.yan-tools-result-stats::before {
    content: '📈';
    margin-right: 4px;
    font-size: 16px;
}

.yan-tools-copy-status {
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yan-tools-copy-status.show {
    opacity: 1;
}

/* Conversion Buttons */
.yan-tools-conversion-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* Settings Section */
.yan-tools-settings-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.yan-tools-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.yan-tools-settings-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #34495e;
}

.yan-tools-settings-actions {
    display: flex;
    gap: 8px;
}

.yan-tools-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.yan-tools-setting-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.yan-tools-setting-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.yan-tools-setting-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.yan-tools-setting-checkbox {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.yan-tools-checkbox-text {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.yan-tools-conversion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.yan-tools-convert-btn {
    padding: 18px 24px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.yan-tools-convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.yan-tools-convert-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.yan-tools-convert-btn:hover::before {
    left: 100%;
}

.yan-tools-convert-btn:active {
    transform: translateY(-1px);
}

.yan-tools-convert-icon {
    display: none;
}

.yan-tools-convert-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .yan-tools-main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .yan-tools-conversion-grid {
        grid-template-columns: 1fr;
    }
    
    .yan-tools-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .yan-tools-section-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .yan-tools-input-footer,
    .yan-tools-result-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .yan-tools-input-stats,
    .yan-tools-result-stats {
        font-size: 12px;
        justify-content: center;
    }
    
    .yan-tools-convert-btn.active::after {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

/* Loading States */
.yan-tools-convert-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    position: relative;
}

.yan-tools-convert-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #6c757d;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Animation */
.yan-tools-convert-btn.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* Active State - когда режим конвертации активен */
.yan-tools-convert-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.yan-tools-convert-btn.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.yan-tools-convert-btn.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    transform: translateY(-3px);
}

/* File Input */
input[type="file"] {
    display: none;
}

/* Scrollbar Styling */
.yan-tools-input-textarea::-webkit-scrollbar,
.yan-tools-result-textarea::-webkit-scrollbar {
    width: 8px;
}

.yan-tools-input-textarea::-webkit-scrollbar-track,
.yan-tools-result-textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.yan-tools-input-textarea::-webkit-scrollbar-thumb,
.yan-tools-result-textarea::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.yan-tools-input-textarea::-webkit-scrollbar-thumb:hover,
.yan-tools-result-textarea::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
