/* General Styles */
body {
    font-family: "Poppins", sans-serif;
    text-align: center;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    transition: background 0.5s, color 0.5s;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* Main Container */
.container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    width: 700px;
    text-align: center;
    transition: background 0.5s, color 0.5s;
}

/* Title */
h2 {
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

/* Content Layout */
.content {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
}

/* Controls Section */
.controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 45%;
}

.controls input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    width: 100%;
    margin-bottom: 10px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

button {
    padding: 10px 15px;
    border: none;
    background: #007bff;
    color: white;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    background: #0056b3;
}

.clear-btn {
    background: #ff4d4d;
}

.clear-btn:hover {
    background: #cc0000;
}

/* Preview Box */
.preview-box {
    width: 50%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #bbb;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
        align-items: center;
    }

    .controls, .preview-box {
        width: 100%;
    }
}
