@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #1b8ef9; /* Red for attention/action */
    --secondary-color: #ffebee; /* Lightest Red */
    --success-color: #4CAF50; /* Green */
    --bg-color: #fafafa;
    --text-color: #212121;
    --border-radius: 10px;
}

/* body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    margin: 0;
    min-height: 100vh;
    color: var(--text-color);
} */

.container {
    background-color: #ffffff;
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 32px;
}

.subtitle {
    text-align: center;
    color: #757575;
    margin-bottom: 30px;
    font-size: 16px;
    font-weight: 400;
}

/* --- Main Content Layout (Two Columns) --- */
.main-content {
    display: flex;
    gap: 30px;
}

.input-section, .output-section {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.input-section {
    background-color: var(--secondary-color);
}

.output-section {
    background-color: #f5f5f5;
}

.input-section h2, .output-section h2 {
    font-size: 20px;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 500;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

/* --- File Input --- */
#imageFile {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px dashed var(--primary-color);
    background-color: #ffffff;
    border-radius: 5px;
    cursor: pointer;
}

/* --- Image Preview --- */
.image-preview {
    min-height: 200px;
    background-color: #ffffff;
    border: 1px solid #bdbdbd;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 10px;
    text-align: center;
}

.image-preview p {
    color: #9e9e9e;
    font-style: italic;
    margin: 0;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* --- Text Area --- */
#outputArea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdbdbd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    resize: vertical;
    font-family: monospace; /* Monospace for code/base64 */
    background-color: #ffffff;
}

/* --- Buttons --- */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    flex: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.success-btn {
    background-color: var(--success-color);
    color: white;
}
.success-btn:hover {
    background-color: #43A047;
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: #757575; /* Grey */
    color: white;
}
.secondary-btn:hover {
    background-color: #616161;
    transform: translateY(-1px);
}

.success-btn.copied {
    background-color: #2e7d32;
    animation: flash-green 0.3s ease-out;
}

@keyframes flash-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); background-color: #81c784; }
    100% { transform: scale(1); background-color: #2e7d32; }
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column; 
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 26px;
    }
    .action-buttons {
        flex-direction: column;
    }
    .image-preview {
        min-height: 150px;
    }
}