body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Slightly more modern font */
    background-color: #E6E6FA; /* Light Purple (Lavender) */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px; /* Add some padding for small screens */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px; /* Slightly more rounded corners */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
    width: 100%; /* Take full width on small screens */
    max-width: 480px; /* Max width for larger screens */
    text-align: center;
    box-sizing: border-box;
}

h1 {
    color: #4B0082; /* Darker purple for heading */
    margin-bottom: 25px;
    font-size: 2em; /* Slightly larger heading */
    font-weight: 600;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

#linkInput {
    padding: 14px; /* More padding */
    border: 2px solid #DDA0DD; /* Medium Purple border */
    border-radius: 10px; /* More rounded input */
    font-size: 1.05em;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%; /* Ensure input takes full width */
    box-sizing: border-box;
    color: #333; /* Darker text for input */
}

#linkInput::placeholder {
    color: #A9A9A9; /* Lighter placeholder text */
}

#linkInput:focus {
    border-color: #8A2BE2; /* Blue Violet on focus */
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2); /* Soft glow on focus */
    outline: none;
}

#generateBtn {
    padding: 14px; /* More padding */
    background-color: #8A2BE2; /* Blue Violet button */
    color: white;
    border: none;
    border-radius: 10px; /* More rounded button */
    cursor: pointer;
    font-size: 1.15em; /* Slightly larger text */
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%; /* Ensure button takes full width */
    box-sizing: border-box;
}

#generateBtn:hover {
    background-color: #6A1BAE; /* Darker purple on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#generateBtn:active {
    transform: scale(0.98);
}

.qr-code-box {
    min-height: 220px; /* Slightly increased min-height */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #DDA0DD; /* Medium Purple dashed border */
    border-radius: 10px;
    padding: 20px;
    background-color: #F8F8FF; /* Ghost White background for the box */
    overflow: hidden; /* Ensure image doesn't overflow */
}

.qr-code-box img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 5px; /* Slight border-radius for the image */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Soft shadow for the image */
    animation: fadeIn 0.6s ease-out forwards; /* Smoother animation */
}

.qr-code-box p {
    color: #8A2BE2; /* Blue Violet for instructional text */
    font-size: 1.05em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Style for when generating/loading */
.qr-code-box.loading {
    color: #8A2BE2; /* Blue Violet for loading text */
    font-weight: bold;
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 25px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    #linkInput,
    #generateBtn {
        font-size: 1em;
        padding: 12px;
    }

    .qr-code-box {
        min-height: 180px;
        padding: 15px;
    }

    .qr-code-box p {
        font-size: 0.95em;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.4em;
    }
    .container {
        padding: 20px;
    }
    .input-section {
        gap: 10px;
    }
}
