@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Inter:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #00d4ff 0%, #090979 50%, #020024 100%);
    --secondary-gradient: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    --success-gradient: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
    --thunder-gradient: linear-gradient(135deg, #ffd700 0%, #ff6b35 50%, #8338ec 100%);
    --card-bg: rgba(15, 15, 25, 0.85);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --shadow-primary: 0 25px 50px rgba(0, 212, 255, 0.3);
    --shadow-thunder: 0 0 30px rgba(255, 215, 0, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-accent: #00d4ff;
    --border-radius: 20px;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated starfield background */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 35%, #0f0f1a 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
    animation-duration: 2s;
}

.star.large {
    width: 3px;
    height: 3px;
    animation-duration: 4s;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Shooting stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, #ffffff, #00d4ff);
    border-radius: 50%;
    box-shadow: 0 0 10px #00d4ff;
    animation: shoot 3s linear infinite;
}

@keyframes shoot {
    0% {
        transform: translateX(-100px) translateY(100px);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(100vw) translateY(-100px);
        opacity: 0;
    }
}

/* Thunder/Lightning effects */
.thunder-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.lightning {
    position: absolute;
    width: 2px;
    height: 100vh;
    background: linear-gradient(to bottom,
            transparent 0%,
            #ffd700 20%,
            #ffffff 50%,
            #00d4ff 80%,
            transparent 100%);
    opacity: 0;
    animation: lightning 8s infinite;
    filter: blur(1px);
    box-shadow: 0 0 20px #ffd700, 0 0 40px #00d4ff;
}

.lightning:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.lightning:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
}

.lightning:nth-child(3) {
    left: 60%;
    animation-delay: 4s;
}

.lightning:nth-child(4) {
    left: 80%;
    animation-delay: 6s;
}

@keyframes lightning {

    0%,
    90%,
    100% {
        opacity: 0;
    }

    1%,
    3% {
        opacity: 1;
    }

    2% {
        opacity: 0.5;
    }
}

/* Electric particles */
.electric-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
    box-shadow: 0 0 10px #00d4ff;
    animation: float-electric 6s infinite linear;
}

@keyframes float-electric {
    0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-primary);
    text-align: center;
    max-width: 550px;
    width: 100%;
    border: 1px solid var(--card-border);
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 1s ease-out forwards;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.container:hover::after {
    opacity: 0.3;
}

@keyframes slideInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header {
    margin-bottom: 40px;
    animation: fadeIn 1s ease-out 0.3s both;
}

.header h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 2.5em;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    letter-spacing: 2px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2em;
    font-weight: 400;
}

#qrcode {
    margin: 40px 0;
    padding: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--card-border);
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.5s both;
    transition: all 0.3s ease;
}

#qrcode:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-thunder);
    border-color: rgba(255, 215, 0, 0.3);
}

#qrcode canvas {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.3);
    transition: transform 0.3s ease;
    animation: scaleIn 0.6s ease-out;
}

#qrcode canvas:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.5);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.url-container {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.7s both;
    transition: all 0.3s ease;
}

.url-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.url-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.url-container:hover::before {
    left: 100%;
}

.url {
    font-family: 'Orbitron', 'Courier New', monospace;
    word-break: break-all;
    color: var(--text-accent);
    font-size: 0.95em;
    font-weight: 500;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.info {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-left: 4px solid #ffd700;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 12px 12px 0;
    color: #ffd700;
    font-size: 14px;
    font-weight: 500;
    animation: fadeIn 1s ease-out 0.9s both;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.info:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-thunder);
}

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
    animation: fadeIn 1s ease-out 1.1s both;
}

.btn {
    background: var(--primary-gradient);
    color: var(--text-primary);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-thunder);
    border-color: #ffd700;
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--secondary-gradient);
    box-shadow: 0 8px 20px rgba(131, 56, 236, 0.3);
    border-color: rgba(131, 56, 236, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    box-shadow: 0 15px 30px rgba(255, 0, 110, 0.4);
}

.loading {
    color: var(--text-accent);
    font-style: italic;
    font-size: 18px;
    font-weight: 500;
    position: relative;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-accent);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

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

.status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.status.show {
    transform: translateY(0);
    opacity: 1;
}

.status.success {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.status.error {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    color: #ff006e;
    border: 1px solid rgba(255, 0, 110, 0.3);
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.error {
    color: #ff006e;
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    border: 1px solid rgba(255, 0, 110, 0.3);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    animation: shake 0.5s ease-in-out;
    backdrop-filter: blur(10px);
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.footer-text {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 30px;
    font-size: 0.9em;
    animation: fadeIn 1s ease-out 1.3s both;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--success-gradient);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 30px 25px;
        margin: 15px;
    }

    .header h2 {
        font-size: 2em;
    }

    .buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px 20px;
    }

    .header h2 {
        font-size: 1.8em;
    }

    #qrcode {
        padding: 20px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--thunder-gradient);
}