@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    background: #e0eafc;
    /* fallback for old browsers */
    background: -webkit-linear-gradient(to right, #cfdef3, #e0eafc);
    /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to right,
            #cfdef3,
            #e0eafc);
    /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
}

.main-content {
    display: flex;
    gap: 30px;
}

.upload-section {
    flex: 1;
    max-width: 600px;
}

.preview-section {
    flex: 1;
    max-width: 600px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: block;
    min-height: 400px;
}

.prompt {
    font-size: 16px;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 20px;
    padding-left: 10px;
    width: 100%;
    resize: vertical;
}

.drag-area {
    height: 400px;
    border: 3px dashed #e0eafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 10px auto;
}

h3 {
    margin-bottom: 20px;
    font-weight: 500;
}

.drag-area .icon {
    font-size: 50px;
    color: #1683ff;
}

.drag-area .header {
    font-size: 20px;
    font-weight: 500;
    color: #34495e;
}

.drag-area .support {
    font-size: 12px;
    color: gray;
    margin: 10px 0 15px 0;
}

.drag-area .button {
    font-size: 20px;
    font-weight: 500;
    color: #1683ff;
    cursor: pointer;
}

.drag-area.active {
    border: 2px solid #1683ff;
}

.drag-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-end;
}

.copy-button,
.clear-button,
.process-button,
.download-button {
    border: none;
    color: white;
    padding: 6px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
}

.copy-button {
    background-color: #4CAF50;
}

.clear-button {
    background-color: #f44336;
}

.process-button {
    background-color: #1683ff;
}

.download-button {
    background-color: #ff5722;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .preview-section {
        max-width: 100%;
    }
    
    fieldset {
        margin-bottom: 15px;
    }
    
    legend {
        font-size: 16px;
    }
}

fieldset {
    border: 2px solid #e0eafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    flex: 1;
}

legend {
    font-size: 18px;
    font-weight: 500;
    color: #1683ff;
    padding: 0 10px;
    background: white;
    border-radius: 5px;
}

.preview-section {
    max-height: 600px; /* Adjust this value as needed */
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-top: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.preview-section::-webkit-scrollbar {
    width: 8px;
}

.preview-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.preview-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.preview-section::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.prompt:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 8px rgba(72, 207, 173, 0.6);
}

.prompt::placeholder {
    color: #888;
    font-style: italic;
}

.template:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 8px rgba(72, 207, 173, 0.6);
}

.template::placeholder {
    color: #888;
    font-style: italic;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.tab {
    border: none;
    color: white;
    padding: 6px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    color: #34495e;
}

.tab.active {
    background-color: #4CAF50;
    color: white;
}

#api-key {
    width: 100%;
    margin: 10px auto;
    padding: 12px;
    border: 2px solid #4CAF50; 
    border-radius: 8px; 
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.3s ease;
}