/* Custom styles for Inter font and general layout */
.image-to-text-converter-wrapper {
    font-family: 'Inter', sans-serif;
    /* Subtle radial gradient background to fill empty space attractively */
    background: radial-gradient(circle at top left, #f3e8ff 0%, #f8fafc 60%, #e0e7ff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Ensure it takes full viewport height for vertical centering */
    padding: 30px 0; /* Increased vertical padding */
    box-sizing: border-box;
    width: 100%;
    animation: fadeIn 0.8s ease-out; /* Fade-in animation for the whole wrapper */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.image-to-text-converter-wrapper .container {
    max-width: 950px; /* Increased max-width for better use of space on larger screens */
    width: 100%;
    background-color: #ffffff;
    border-radius: 1.5rem; /* More rounded corners */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15); /* More prominent shadow */
    padding: 3.5rem; /* Increased padding for more breathing room */
    text-align: center;
    margin: 0 auto; /* Center the container horizontally */
    border: 1px solid #e2e8f0; /* Subtle border */
    /* Add a subtle inner shadow or border for depth */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

/* Headings and paragraphs */
.image-to-text-converter-wrapper h2 {
    color: #2d3748; /* Darker gray for heading */
    font-size: 2.5rem; /* Larger heading */
    margin-bottom: 1rem;
}

.image-to-text-converter-wrapper p {
    color: #4a5568; /* Slightly darker gray for paragraph */
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

/* Language Selection */
.image-to-text-converter-wrapper .language-selection {
    margin-bottom: 2.5rem;
}

.image-to-text-converter-wrapper .language-selection label {
    color: #4a5568;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.image-to-text-converter-wrapper #language-select {
    appearance: none; /* Remove default dropdown arrow */
    background-color: #f9fafb;
    border: 2px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%236d28d9%22%20d%3D%22M287%20197.3L159.2%2069.5c-3.6-3.6-8.4-5.4-13.2-5.4s-9.6%201.8-13.2%205.4L5.4%20197.3c-7.2%207.2-7.2%2018.8%200%2026.1s18.8%207.2%2026.1%200l127.7-127.7L261%20223.4c7.2%207.2%2018.8%207.2%2026.1%200s7.2-18.8%200-26.1z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8em auto;
}

.image-to-text-converter-wrapper #language-select:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.image-to-text-converter-wrapper #language-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.3);
}


/* Drag and drop area styling */
.image-to-text-converter-wrapper .drop-area {
    border: 3px dashed #a78bfa;
    background-color: #f3e8ff;
    border-radius: 1rem; /* More rounded */
    padding: 3rem; /* More padding */
    margin-bottom: 2.5rem;
    cursor: pointer;
    transition: all 0.4s ease; /* Slower transition */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.image-to-text-converter-wrapper .drop-area.hover {
    background-color: #e9d5ff;
    border-color: #8b5cf6;
    transform: scale(1.02); /* Slight scale on hover */
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}
.image-to-text-converter-wrapper .drop-area p {
    color: #6d28d9;
    font-size: 1.25rem; /* Larger text */
    font-weight: 700; /* Bolder text */
    margin-top: 1.25rem;
    transition: color 0.3s ease;
}
.image-to-text-converter-wrapper .drop-area.hover p {
    color: #4c1d95; /* Darker purple text on hover */
}
/* Ensure SVG within drop-area is always sized correctly */
.image-to-text-converter-wrapper .drop-area svg {
    width: 4rem; /* Equivalent to w-16 */
    height: 4rem; /* Equivalent to h-16 */
    transition: transform 0.3s ease;
}
.image-to-text-converter-wrapper .drop-area.hover svg {
    transform: translateY(-5px) scale(1.1); /* Slight lift and scale on hover */
}

/* Image preview styling */
.image-to-text-converter-wrapper #image-preview {
    max-width: 100%;
    max-height: 350px; /* Slightly taller preview */
    border-radius: 1rem;
    margin-top: 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* Enhanced shadow */
    display: none; /* Hidden by default in CSS */
    object-fit: contain;
    border: 2px solid #e0e7ff; /* Light border */
    transition: transform 0.3s ease;
}
.image-to-text-converter-wrapper #image-preview.loaded {
    animation: imageFadeIn 0.5s ease-out; /* Fade in animation for image */
}
@keyframes imageFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}


/* Button styling */
.image-to-text-converter-wrapper .btn {
    background: linear-gradient(to right, #8b5cf6, #a78bfa);
    color: white;
    padding: 1rem 2.5rem; /* More padding */
    border-radius: 0.75rem;
    font-weight: 700; /* Bolder text */
    letter-spacing: 0.05em; /* Slight letter spacing */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.4); /* More shadow */
    border: none;
    position: relative;
    overflow: hidden;
}
.image-to-text-converter-wrapper .btn:hover {
    background: linear-gradient(to right, #a78bfa, #8b5cf6);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.6);
    transform: translateY(-3px) scale(1.02); /* More pronounced hover effect */
}
.image-to-text-converter-wrapper .btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4);
}
.image-to-text-converter-wrapper .btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* Text area styling */
.image-to-text-converter-wrapper #extracted-text {
    width: 100%;
    min-height: 180px; /* Taller text area */
    border: 2px solid #c3dafe; /* Slightly darker blue border */
    border-radius: 1rem; /* More rounded */
    padding: 1.25rem; /* More padding */
    margin-top: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    resize: vertical;
    background-color: #fdfefe; /* Whiter background */
    color: #2d3748;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.08); /* Deeper inset shadow */
    transition: all 0.3s ease;
    display: none; /* Hidden by default in CSS */
}
.image-to-text-converter-wrapper #extracted-text:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.08), 0 0 0 4px rgba(139, 92, 246, 0.2);
}

/* Loading spinner styling */
.image-to-text-converter-wrapper .spinner {
    border: 5px solid rgba(0, 0, 0, 0.1); /* Thicker border */
    border-left-color: #8b5cf6;
    border-radius: 50%;
    width: 40px; /* Larger spinner */
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem; /* Space between spinner and text */
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); /* Glow effect for spinner */
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress text styling */
.image-to-text-converter-wrapper #progress-text {
    font-size: 1.8rem; /* Larger font size for percentage */
    font-weight: 700; /* Bolder font */
    background: linear-gradient(to right, #8b5cf6, #ef4444, #f97316); /* Colorful gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback for non-webkit browsers */
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3); /* Subtle text shadow */
}

/* Loading Area container */
.image-to-text-converter-wrapper #loading-area {
    display: none; /* Hidden by default in CSS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem; /* Add margin for spacing */
}

/* Message box styling */
.image-to-text-converter-wrapper .message-box {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem; /* More rounded */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    padding: 30px;
    max-width: 450px; /* Wider message box */
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
    animation: popIn 0.3s ease-out; /* Pop-in animation */
}
@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.image-to-text-converter-wrapper .message-box h3 {
    margin-top: 0;
    color: #2d3748;
    font-size: 1.75rem; /* Larger heading */
    margin-bottom: 1rem;
}
.image-to-text-converter-wrapper .message-box p {
    margin-bottom: 25px;
    color: #4a5568;
    font-size: 1.05rem;
}
.image-to-text-converter-wrapper .message-box button {
    background-color: #8b5cf6;
    color: white;
    padding: 12px 25px; /* More padding */
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: 600;
}
.image-to-text-converter-wrapper .message-box button:hover {
    background-color: #a78bfa;
    transform: translateY(-2px);
}

.image-to-text-converter-wrapper .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
    z-index: 999;
    display: none;
    animation: fadeInOverlay 0.3s ease-out;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1024px) { /* Adjust max-width for medium screens (smaller laptops/larger tablets) */
    .image-to-text-converter-wrapper .container {
        max-width: 850px; /* Revert to previous max-width for these devices */
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .image-to-text-converter-wrapper .container {
        padding: 2rem;
        border-radius: 1rem;
    }
    .image-to-text-converter-wrapper h2 {
        font-size: 2rem;
    }
    .image-to-text-converter-wrapper p {
        font-size: 1rem;
    }
    .image-to-text-converter-wrapper .drop-area {
        padding: 2rem;
    }
    .image-to-text-converter-wrapper .drop-area p {
        font-size: 1rem;
    }
    .image-to-text-converter-wrapper .btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
    .image-to-text-converter-wrapper #extracted-text {
        min-height: 120px;
        padding: 1rem;
        font-size: 0.95rem;
    }
    .image-to-text-converter-wrapper .message-box {
        max-width: 90%;
        padding: 20px;
    }
    .image-to-text-converter-wrapper #progress-text {
        font-size: 1.5rem; /* Smaller font for mobile */
    }
}