/* OCR - Screenshot to Text Specific Styles */

.tool-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Upload Card */
.upload-card {
    background: white;
    border-radius: 30px;
    border: 1px solid #e5e7eb;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.dark-mode .upload-card {
    background: #1f2937;
    border-color: #374151;
}

.upload-area {
    border: 2px dashed #e5e7eb;
    border-radius: 30px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f9fafb;
}

.dark-mode .upload-area:hover {
    background: #2d3748;
}

.upload-area i {
    font-size: 4rem;
    color: #3b82f6;
    margin-bottom: 15px;
}

.upload-area h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #111827;
}

.dark-mode .upload-area h3 {
    color: #f9fafb;
}

.upload-area p {
    color: #6b7280;
    margin-bottom: 5px;
}

.upload-area .supported-formats {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border-radius: 20px;
    padding: 20px;
}

.dark-mode .file-info {
    background: #111827;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-details i {
    font-size: 2rem;
    color: #3b82f6;
}

.file-name {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 5px;
}

.dark-mode .file-name {
    color: #f9fafb;
}

.file-size {
    font-size: 0.85rem;
    color: #6b7280;
}

.change-file-btn {
    padding: 10px 20px;
    background: #e5e7eb;
    border: none;
    border-radius: 60px;
    color: #111827;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .change-file-btn {
    background: #374151;
    color: #f9fafb;
}

.change-file-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Language Card */
.language-card {
    background: white;
    border-radius: 30px;
    border: 1px solid #e5e7eb;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.dark-mode .language-card {
    background: #1f2937;
    border-color: #374151;
}

.language-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.language-header i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.language-header h3 {
    font-size: 1.2rem;
    color: #111827;
}

.dark-mode .language-header h3 {
    color: #f9fafb;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .language-option {
    background: #111827;
    border-color: #374151;
}

.language-option:hover {
    border-color: #3b82f6;
}

.language-option input[type="radio"] {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
    margin: 0;
}

.language-name {
    color: #111827;
    font-size: 0.9rem;
}

.dark-mode .language-name {
    color: #f9fafb;
}

/* OCR Options */
.ocr-options {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 20px;
}

.dark-mode .ocr-options {
    background: #111827;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 0.95rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

/* Extract Button */
.extract-btn {
    width: 100%;
    padding: 16px 30px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.extract-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px #8b5cf6;
}

.extract-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: #f9fafb;
    border-radius: 30px;
    margin-bottom: 20px;
}

.dark-mode .loading {
    background: #111827;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-note {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: #8b5cf6;
    width: 0%;
    transition: width 0.3s ease;
}

.ocr-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: #6b7280;
    font-size: 0.9rem;
}

.ocr-tip i {
    color: #f59e0b;
}

/* Result Card */
.result-card {
    background: white;
    border-radius: 30px;
    border: 1px solid #e5e7eb;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.dark-mode .result-card {
    background: #1f2937;
    border-color: #374151;
}

.result-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode .result-header {
    border-bottom-color: #374151;
}

.preview-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #8b5cf6;
}

/* Text Editor */
.text-editor {
    margin-bottom: 25px;
}

.extracted-text {
    width: 100%;
    min-height: 250px;
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #111827;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.dark-mode .extracted-text {
    background: #111827;
    border-color: #374151;
    color: #f9fafb;
}

.extracted-text:focus {
    border-color: #8b5cf6;
}

.extracted-text:not(:read-only) {
    background: white;
    border-color: #8b5cf6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 60px;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dark-mode .action-btn {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

.action-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.dark-mode .action-btn:hover {
    background: #4b5563;
}

/* Edit Controls */
.edit-controls {
    display: flex;
    gap: 10px;
}

.save-btn {
    flex: 2;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: #059669;
}

.cancel-btn {
    flex: 1;
    padding: 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 60px;
    color: #111827;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode .cancel-btn {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

.cancel-btn:hover {
    background: #e5e7eb;
}

.dark-mode .cancel-btn:hover {
    background: #4b5563;
}

/* Info Section */
.info-section {
    background: #f9fafb;
    border-radius: 30px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid #e5e7eb;
}

.dark-mode .info-section {
    background: #111827;
    border-color: #374151;
}

.info-section h3 {
    font-size: 1.3rem;
    margin: 20px 0 15px;
    color: #111827;
}

.dark-mode .info-section h3 {
    color: #f9fafb;
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

.dark-mode .info-section p {
    color: #9ca3af;
}

.info-section ul {
    list-style: none;
    padding: 0;
}

.info-section ul li {
    padding: 8px 0;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-mode .info-section ul li {
    color: #9ca3af;
}

/* Supported Languages */
.supported-languages {
    margin: 20px 0;
}

.supported-languages h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #111827;
}

.dark-mode .supported-languages h4 {
    color: #f9fafb;
}

.language-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-badge {
    padding: 6px 12px;
    background: #e5e7eb;
    border-radius: 60px;
    font-size: 0.8rem;
    color: #111827;
}

.dark-mode .lang-badge {
    background: #374151;
    color: #f9fafb;
}

.note {
    margin-top: 20px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 60px;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.dark-mode .note {
    background: #1f2937;
    border-color: #374151;
}

.note i {
    color: #3b82f6;
    margin-right: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .result-stats {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}