/* Image to Text Converter - Main Styles */
.ittc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ittc-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 20px;
}

.ittc-title {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-align: center;
}

.ittc-description {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* Upload Area */
.ittc-upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 25px;
}

.ittc-upload-area:hover,
.ittc-upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ittc-upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ittc-upload-icon {
    color: #9ca3af;
    margin-bottom: 10px;
}

.ittc-upload-area:hover .ittc-upload-icon {
    color: #3b82f6;
}

.ittc-upload-area h3 {
    color: #374151;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.ittc-upload-hint {
    color: #6b7280;
    font-size: 14px;
    margin: 5px 0;
}

.ittc-file-types {
    color: #9ca3af;
    font-size: 13px;
    margin: 5px 0 15px;
}

/* Buttons */
.ittc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.ittc-btn-primary {
    background: #3b82f6;
    color: white;
}

.ittc-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.ittc-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    transform: none;
}

.ittc-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.ittc-btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
}

.ittc-btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.ittc-btn-remove {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ittc-btn-remove:hover {
    background: #f3f4f6;
    color: #ef4444;
}

/* Preview Container */
.ittc-preview-container {
    background: #f9fafb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.ittc-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.ittc-preview-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.ittc-image-wrapper {
    padding: 20px;
    text-align: center;
    max-height: 300px;
    overflow: hidden;
}

.ittc-image-wrapper img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 6px;
    object-fit: contain;
}

/* Actions */
.ittc-actions {
    text-align: center;
    margin: 25px 0;
}

.ittc-btn .ittc-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ittc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ittc-spin 0.8s linear infinite;
}

@keyframes ittc-spin {
    to { transform: rotate(360deg); }
}

/* Result Container */
.ittc-result-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.ittc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.ittc-result-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.ittc-result-actions {
    display: flex;
    gap: 10px;
}

.ittc-text-wrapper {
    position: relative;
}

.ittc-textarea {
    width: 100%;
    padding: 20px;
    border: none;
    background: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    color: #374151;
}

.ittc-textarea:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.ittc-text-info {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #6b7280;
}

/* Messages */
.ittc-error-message,
.ittc-success-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.ittc-error-message {
    background: #fee;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.ittc-success-message {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* Footer */
.ittc-footer {
    text-align: center;
    padding: 15px;
    color: #9ca3af;
    font-size: 14px;
}

.ittc-footer-text {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ittc-card {
        padding: 20px;
    }
    
    .ittc-title {
        font-size: 24px;
    }
    
    .ittc-description {
        font-size: 15px;
    }
    
    .ittc-upload-area {
        padding: 30px 15px;
    }
    
    .ittc-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ittc-result-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .ittc-container {
        padding: 10px;
    }
    
    .ittc-actions .ittc-btn {
        width: 100%;
    }
    
    .ittc-result-actions {
        flex-direction: column;
    }
    
    .ittc-result-actions .ittc-btn {
        width: 100%;
    }
}

/* Accessibility */
.ittc-btn:focus,
.ittc-textarea:focus,
.ittc-btn-remove:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading state */
.ittc-loading {
    opacity: 0.7;
    pointer-events: none;
}

.ittc-loading .ittc-btn-text {
    display: none;
}

.ittc-loading .ittc-loader {
    display: flex !important;
}