*{
    box-sizing: border-box;
}

body{
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 500px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(600px circle at 50% 0%, rgba(120, 119, 198, 0.1), transparent 40%);
    pointer-events: none;
}

input[type="color"]{
    border: none;
    width: 32%;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

input[type="color"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
}

input[type="color"]::-webkit-color-swatch-wrapper{
    padding: 0;
    border-radius: 12px;
}

input[type="color"]::-webkit-color-swatch{
    border: none;
    border-radius: 12px;
}

a{
    text-decoration: none;
}

.qr-text{
    padding: 16px 20px;
    display: block;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    width: 100%;
    margin: 12px 0 20px 0;
    color: #f1f5f9;
    outline: none;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.qr-text:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.qr-text::placeholder{
    color: #94a3b8;
    font-weight: 400;
}

#qr-code{
    height: 500px;
    width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 24px;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

#qr-code::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#qr-code img, #qr-code canvas{
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 16px;
}

.row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sizes{
    width: 32%;
    height: 48px;
    color: #f1f5f9;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 12px;
    outline: none;
    padding: 0 16px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.sizes:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn{
    color: #ffffff;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5b5fb8 0%, #7c3aed 100%);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

.btn img{
    width: 20px;
    height: 20px;
    margin-left: 12px;
    filter: brightness(0) invert(1);
}

.share-btn{
    margin-left: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.3);
}

.share-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 20px 35px -10px rgba(16, 185, 129, 0.4);
}

.action-container{
    display: flex;
    margin: 24px 0;
    gap: 16px;
}

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

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.8);
}

@media (max-width: 512px){
    body{
        max-width: 100%;
        padding: 16px;
    }
    
    #qr-code{
        width: min(95vw, 400px);
        height: min(95vw, 400px);
        border-radius: 20px;
    }
    
    #qr-code img, #qr-code canvas{
        max-width: 95vw !important;
        max-height: 95vw !important;
    }
    
    .btn{
        min-width: unset;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .qr-text {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

@media (max-width: 350px){
    .action-container{
        flex-direction: column;
        gap: 12px;
    }
    
    .share-btn{
        margin-left: 0;
    }
    
    .row {
        gap: 8px;
    }
    
    input[type="color"], .sizes {
        height: 44px;
    }
}