body {
    background: linear-gradient(135deg, #6f86d6, #48c6ef);
    font-family: 'Poppins', sans-serif;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 5vh 2vw;
    margin: 0;
    position: relative;
}

body.dark-mode {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: #ecf0f1;
}

h1 {
    font-size: 5vw;
    text-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 5vh;
    text-align: center;
}

.toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    user-select: none;
}

.toggle-container input {
    display: none;
}

.toggle-container label {
    width: 50px;
    height: 25px;
    background: #ccc;
    border-radius: 25px;
    position: relative;
    transition: background 0.3s;
}

.toggle-container label::after {
    content: '';
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-container input:checked + label {
    background: #66bb6a;
}

.toggle-container input:checked + label::after {
    transform: translateX(25px);
}

.toggle-container span {
    margin-left: 10px;
    font-size: 1rem;
}

canvas {
    border: 3px solid white;
    border-radius: 10px;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.4);
    cursor: none;
    transition: transform 0.3s ease, border-color 0.3s, box-shadow 0.3s;
    width: 90vw;
    max-width: 500px;
    height: auto;
}

body.dark-mode canvas {
    border-color: #ecf0f1;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.6);
}

canvas:hover {
    transform: scale(1.05);
}

#generated-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 128px;
    height: auto;
    border: 2px solid white;
    border-radius: 10px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    animation: pulse 10s infinite ease-in-out;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    pointer-events: none;
    z-index: 1000; 
}

body.dark-mode #generated-image {
    border-color: #ecf0f1;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.7);
}

/* Popup */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.5);
    padding: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideDown 0.5s ease;
    max-width: 80vw;
}

.popup img {
    width: 80vw;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
}

.popup button {
    margin: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #ff512f, #dd2476);
    border: none;
    border-radius: 5px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

.popup button:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #dd2476, #ff512f);
}

.popup button:active {
    transform: translateY(2px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -60%);
    }
    to {
        transform: translate(-50%, -50%);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 10vw;
    }

    .toggle-container {
        top: 10px;
        right: 10px;
    }

    .toggle-container span {
        font-size: 0.9rem;
    }

    #generated-image {
        width: 80px;
    }
}

/* Style for AR Mode Button */
#ar-mode-btn {
    padding: 10px 20px;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #ff512f, #dd2476);
    border: none;
    border-radius: 5px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
    margin-top: 20px;
}

/* Hover Effects */
#ar-mode-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #dd2476, #ff512f);
}

/* Active (Click) Effects */
#ar-mode-btn:active {
    transform: translateY(2px);
}

/* Dark Mode Styles */
body.dark-mode #ar-mode-btn {
    background: linear-gradient(135deg, #555, #333);
    color: #ecf0f1;
}

/* Dark Mode Hover Effects */
body.dark-mode #ar-mode-btn:hover {
    background: linear-gradient(135deg, #333, #555);
}
