body {
    background-color: #0b1220;
    color: #e6f1ff;
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #4fd1c5;
}

.container {
    display: flex;
    gap: 50px;
    margin-bottom: 20px;
}

.phone-container {
    width: 300px;
    height: 600px;
    background-color: #0b1220;
    border-radius: 30px;
    box-shadow: 10px 10px 20px #060910, -10px -10px 20px #101b30;
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

.phone-container:hover {
    transform: translateY(-5px);
    box-shadow: 15px 15px 30px #060910, -15px -15px 30px #101b30;
}

.screen {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    height: 100%;
    border-radius: 20px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease-in-out;
}

.screen.dragover {
    border: 2px dashed #4fd1c5;
    background: rgba(79, 209, 197, 0.2);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.image-gallery img {
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-gallery img:hover {
    transform: scale(1.05);
}

.image-gallery img.selected {
    border: 3px solid #4fd1c5;
    box-shadow: 0 0 25px #4fd1c5, 0 0 40px #4fd1c5;
    transform: scale(1.15) rotate(3deg);
    transition: all 0.3s ease-in-out;
}

.upload-btn {
    background-color: #0b1220;
    color: #4fd1c5;
    border: 1px solid #4fd1c5;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: block;
    margin: 20px auto;
    box-shadow: 5px 5px 10px #060910, -5px -5px 10px #101b30;
    transition: all 0.2s ease-in-out;
}

.upload-btn:hover {
    color: #0b1220;
    background-color: #4fd1c5;
    box-shadow: inset 5px 5px 10px #3aa99e, inset -5px -5px 10px #64f7ec;
}

.instructions {
    margin-top: 20px;
    font-style: italic;
    color: #8892b0;
}

footer {
    position: absolute;
    bottom: 10px;
    font-size: 0.8em;
    color: #8892b0;
}

#qr-container {
    text-align: center;
    margin-top: 20px;
}

#connect-btn {
    background-color: #0b1220;
    color: #4fd1c5;
    border: 1px solid #4fd1c5;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    box-shadow: 5px 5px 10px #060910, -5px -5px 10px #101b30;
    transition: all 0.2s ease-in-out;
}

#connect-btn:hover {
    color: #0b1220;
    background-color: #4fd1c5;
    box-shadow: inset 5px 5px 10px #3aa99e, inset -5px -5px 10px #64f7ec;
}

#qrcode {
    display: inline-block;
    background-color: #fff;
    padding: 10px;
    border-radius: 10px;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#history-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #0b1220;
    color: #4fd1c5;
    border: 1px solid #4fd1c5;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 5px 5px 10px #060910, -5px -5px 10px #101b30;
    transition: all 0.2s ease-in-out;
}

#history-btn:hover {
    color: #0b1220;
    background-color: #4fd1c5;
    box-shadow: inset 5px 5px 10px #3aa99e, inset -5px -5px 10px #64f7ec;
}

#history-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    max-width: 500px;
    background: rgba(11, 18, 32, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 10px 10px 20px #060910, -10px -10px 20px #101b30;
    z-index: 100;
}

#history-list {
    list-style: none;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

#history-list li {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 20px;
    }

    .phone-container {
        width: 90vw;
        height: 70vh;
    }

    header h1 {
        font-size: 1.5em;
    }
}