/* --- Basic Setup & Font --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    background: linear-gradient(45deg, #1d2b64, #f8cdda);
    overflow: hidden;
    color: #333;
}

/* --- Main Layout --- */
.main-layout {
    display: flex;
    gap: 40px;
    width: 80%;
    max-width: 1200px;
    align-items: flex-start;
}

.container,
.output-container {
    padding: 30px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.container {
    flex: 1;
}

.output-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

h1,
h3 {
    color: #fff;
    margin-top: 0;
    font-weight: 600;
    text-align: center;
}

p {
    color: #eee;
    margin-bottom: 25px;
    text-align: center;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #eee;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s;
}

.tab-btn.active {
    background: #fff;
    color: #1d2b64;
    font-weight: 500;
}

/* --- Input Panels --- */
.panel {
    display: none;
}

.panel.active {
    display: block;
}

.qr-input,
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

textarea {
    resize: vertical;
}

select option {
    background-color: #333;
}

.qr-input::placeholder {
    color: #ccc;
}

.qr-input:focus {
    border-color: #f8cdda;
    box-shadow: 0 0 10px rgba(248, 205, 218, 0.5);
}

/* --- Customization Section --- */
.customization {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
    color: #fff;
}

.color-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

/* --- QR Code & Actions --- */
#qrCodeContainer {
    width: 250px;
    height: 250px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* This targets the canvas element generated by the library */
#qrCodeContainer canvas {
    border-radius: 6px;
}

.action-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.secondary-btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.download-wrapper {
    display: flex;
}

#downloadBtn {
    border-radius: 10px 0 0 10px;
}

#downloadFormat {
    background-color: #007bff;
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0 10px 10px 0;
    padding: 0 10px;
    cursor: pointer;
}

/* --- History --- */
.history-container {
    margin-top: 25px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

#historyList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#historyList li {
    background: rgba(0, 0, 0, 0.2);
    color: #eee;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#historyList li:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Background Animation --- */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-shapes::after,
.background-shapes::before {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: rotate 25s linear infinite;
}

.background-shapes::after {
    width: 600px;
    height: 600px;
    background: #f8cdda;
    bottom: -350px;
    left: -200px;
    opacity: 0.5;
}

.background-shapes::before {
    width: 500px;
    height: 500px;
    background: #1d2b64;
    top: -250px;
    right: -200px;
    opacity: 0.6;
    animation-direction: reverse;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
    }

    .container,
    .output-container {
        width: 100%;
        max-width: 500px;
    }
}