:root {
    --primary: #4285F4;
    --secondary: #34A853;
    --accent: #EA4335;
    --light: #f8f9fa;
    --dark: #202124;
    --success: #34A853;
    --error: #EA4335;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #5f6368;
    max-width: 700px;
    margin: 0 auto;
}

.converter-container {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 2px dashed #dadce0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-section:hover {
    border-color: var(--primary);
    background-color: rgba(66, 133, 244, 0.05);
}

.upload-section.active {
    border-color: var(--success);
    background-color: rgba(52, 168, 83, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-align: center;
}

.upload-subtext {
    color: #5f6368;
    text-align: center;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #3367d6;
    box-shadow: 0 1px 2px 0 rgba(66, 133, 244, 0.3), 0 1px 3px 1px rgba(66, 133, 244, 0.15);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: rgba(66, 133, 244, 0.05);
}

.preview-section {
    display: none;
    gap: 2rem;
}

.preview-section.active {
    display: flex;
}

.image-preview {
    flex: 1;
    max-width: 50%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.text-result {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.text-result-content {
    flex: 1;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 400px;
    border: 1px solid #e9ecef;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

#fileInput {
    display: none;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(66, 133, 244, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1rem;
    color: var(--dark);
    font-weight: 500;
}

.error-message {
    color: var(--error);
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    display: none;
}

.error-message.active {
    display: block;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #5f6368;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .preview-section {
        flex-direction: column;
    }
    
    .image-preview {
        max-width: 100%;
    }
}