/* Handwriting Text Converter Styles */
.htc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.htc-header {
    text-align: center;
    margin-bottom: 40px;
}

.htc-header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.htc-header h1 .dashicons {
    color: #3498db;
    margin-right: 15px;
    font-size: 1.2em;
}

.htc-header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Upload Area */
.htc-upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.htc-upload-area:hover,
.htc-upload-area.dragover {
    border-color: #3498db;
    background: #e8f4fc;
}

.upload-icon .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    color: #3498db;
    margin-bottom: 20px;
}

.htc-upload-area h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.htc-upload-area p {
    color: #7f8c8d;
    margin: 5px 0;
}

/* Options */
.htc-options {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
}

#htc-output-format,
#htc-detect-tables {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
}

#htc-detect-tables {
    width: 20px;
    height: 20px;
}

/* Files Preview */
.htc-files-preview {
    margin-bottom: 30px;
}

.htc-files-preview h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

#htc-files-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #3498db;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.1);
}

.file-thumb {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 5px;
    color: #bdc3c7;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9em;
}

.file-error {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
}

.file-remove {
    background: #e74c3c;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    margin-left: 10px;
}

.file-remove:hover {
    opacity: 1;
}

.file-status {
    margin-left: 10px;
    color: #bdc3c7;
}

.file-item.uploaded .file-status {
    color: #27ae60;
}

.file-item.error .file-status {
    color: #e74c3c;
}

.file-item.uploading .file-status .dashicons {
    animation: htc-spin 2s linear infinite;
}

/* Actions */
.htc-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.htc-button-primary,
.htc-button-secondary,
.htc-button-small {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.htc-button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    flex: 1;
}

.htc-button-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.htc-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.htc-button-secondary {
    background: #95a5a6;
    color: white;
    flex: 1;
}

.htc-button-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.htc-button-small {
    padding: 8px 15px;
    font-size: 0.9em;
    background: #ecf0f1;
    color: #2c3e50;
}

.htc-button-small:hover {
    background: #d5dbdb;
}

.htc-button-small.htc-button-primary {
    background: #3498db;
    color: white;
}

.htc-button-small.htc-button-primary:hover {
    background: #2980b9;
}

/* Progress */
.htc-progress {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-bar {
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #7f8c8d;
}

/* Results */
.htc-results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    color: #2c3e50;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.results-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

#htc-text-output {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    color: #2c3e50;
}

/* Error */
.htc-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.htc-error .dashicons {
    font-size: 24px;
    flex-shrink: 0;
}

/* Animations */
@keyframes htc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .htc-container {
        padding: 20px;
    }
    
    .htc-header h1 {
        font-size: 2em;
    }
    
    .htc-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .htc-actions {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-actions {
        width: 100%;
        justify-content: flex-start;
    }
}