body {
    font-family: 'SF Pro Display', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 0 20px;
}

.header-section {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.content-wrapper {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.section {
    flex: 1;
    min-width: 400px;
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

h2 {
    color: #2c3e50;
    margin-top: 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: inline-block;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background-color: #f8fafc;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3498db;
    background-color: #eff6ff;
}

.upload-content p {
    margin-top: 10px;
    color: #718096;
}

.upload-content i {
    color: #3498db;
}

/* Preview Images */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-area {
    margin: 20px 0;
    text-align: center;
}

.image-preview-box {
    min-height: 200px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f7fafc;
    overflow: hidden;
}

.placeholder-text {
    color: #a0aec0;
}

/* Inputs and Buttons */
textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    resize: vertical;
    font-family: monospace;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
    /* Important for padding */
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: auto;
    /* Push to bottom */
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    flex: 1;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

#clear-img-btn,
#clear-base64-btn {
    background-color: #e53e3e;
}

#clear-img-btn:hover,
#clear-base64-btn:hover {
    background-color: #c53030;
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e2e8f0;
}

body.dark-mode .section {
    background-color: #2d2d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-mode h2,
body.dark-mode .header-section {
    color: #f7fafc;
}

body.dark-mode textarea {
    background-color: #4a5568;
    color: #f7fafc;
    border-color: #718096;
}

body.dark-mode .upload-area {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .upload-area:hover {
    background-color: #4a5568;
}

body.dark-mode .image-preview-box {
    background-color: #2d3748;
    border-color: #4a5568;
}

@media (max-width: 900px) {
    main {
        padding-top: 20px;
    }

    .content-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .section {
        width: 100%;
        min-width: unset;
    }
}