/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.form-section {
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
}

#urlInput {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#urlInput:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

#urlInput:invalid {
    border-color: #ff6b6b;
}

.options-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.option label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

#sizeSelect {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#sizeSelect:focus {
    outline: none;
    border-color: #4facfe;
}

#colorPicker, #bgColorPicker {
    width: 60px;
    height: 45px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#colorPicker:hover, #bgColorPicker:hover {
    transform: scale(1.05);
}

/* Le gros btn bleu pour générer le QR code */
.generate-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.btn-icon {
    font-size: 1.3rem;
}

/* Zone où on affiche le QR code */
.result-section {
    display: none;
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #e1e8ed;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section.show {
    display: block;
}

.qr-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

#qrcode {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.clear-btn {
    background: #dc3545;
    color: white;
}

.clear-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.info {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
    text-align: left;
}

.info p {
    margin: 0;
    word-break: break-all;
}

#encodedUrl {
    color: #4facfe;
    font-weight: 600;
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 25px;
    border-top: 1px solid #e1e8ed;
    color: #666;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-content .tip {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e8ed;
}

.footer-info {
    margin-top: 15px;
}

.footer-info p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.footer-info p:first-child {
    font-weight: 600;
    color: #4facfe;
    font-size: 1rem;
}

.footer-note {
    font-style: italic;
    color: #888;
    font-size: 0.9rem !important;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 15px;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.github-btn:hover {
    background: #2f363d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(36, 41, 46, 0.3);
    text-decoration: none;
    color: white;
}

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

.github-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Quand ça charge, on rend tout un peu transparent */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .generate-btn {
    background: #ccc;
}

/* Responsive pour les écrans plus petits */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .options-group {
        grid-template-columns: 1fr;
    }

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

    .action-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .github-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .generate-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
    }

    .footer-info p {
        font-size: 0.85rem;
    }

    .footer-info p:first-child {
        font-size: 0.9rem;
    }

    .footer-note {
        font-size: 0.8rem !important;
    }

    .github-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .github-btn svg {
        width: 16px;
        height: 16px;
    }
}


/* Petite  secoussecous ( comme un tremblement de terre à Casablanca - rapport au coucous tout ca ..) quand il y a une erreur */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}


/* Messages d'erreur en rouge */
.error-message {
    background: #ff6b6b;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}


/* Messages de succès en vert */
.success-message {
    background: #28a745;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}
