/* generateur-qrcode.css - Styles du générateur QR Code */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Barlow';
    src: url('../font/Barlow-Regular.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Barlow';
    background: #fafafa;
    color: #000000;
    line-height: 1.6;
    font-size: 15px;
    font-weight: 400;
}

button, a, .type-card {
    cursor: pointer;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #000;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 15px;
    text-align: center;
    margin-top: 70px;
}

.page-subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: center;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
}

.form-section {
    background: white;
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.form-section::-webkit-scrollbar {
    width: 8px;
}

.form-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.form-section::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.section-title {
    background: #ff9320;
    color: #fffef5;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 25px;
    text-transform: lowercase;
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.type-card {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.type-card:hover {
    border-color: #000;
    background: white;
}

.type-card.active {
    background: #000000;
    border-color: #000000;
    color: white;
}

.type-card.active .type-icon {
    color: #ff9320;
}

.type-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #000;
    transition: all 0.3s ease;
}

.type-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s;
    background: white;
    color: #000;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #000;
    background: #fafafa;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #666;
}

.content-type {
    display: none;
}

.content-type.active {
    display: block;
}

.customization-section {
    background: #fafafa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.customization-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-picker-item label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.color-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.color-input-wrapper input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.size-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.size-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
}

.size-option:hover {
    border-color: #000;
}

.size-option.active {
    background: #000;
    color: white;
    border-color: #000;
}

.logo-upload {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
}

.logo-upload:hover {
    border-color: #ff9320;
    background: #fffef5;
}

.logo-upload-icon {
    font-size: 1.5rem;
    color: #ff9320;
    margin-bottom: 8px;
}

.logo-upload p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.logo-upload input[type="file"] {
    display: none;
}

.btn-upload-logo {
    background: transparent;
    border: 2px solid #000;
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload-logo:hover {
    background: #000;
    color: white;
}

.logo-preview {
    display: none;
    margin-top: 12px;
}

.logo-preview.active {
    display: block;
}

.logo-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.btn-remove-logo {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.btn-generate {
    background: #000000;
    color: white;
    border: 2px solid #000000;
    padding: 14px 35px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-generate:hover {
    background: #ff9320;
    color: #000;
    border-color: #ff9320;
}

.btn-generate:disabled {
    background: #e0e0e0;
    color: #999;
    border-color: #e0e0e0;
    cursor: not-allowed;
}   

.preview-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.preview-section::-webkit-scrollbar {
    width: 6px;
}

.preview-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.preview-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.preview-title {
    background: #ff9320;
    color: #fffef5;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 25px;
    text-transform: lowercase;
}

.qr-preview {
    background: #fafafa;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#qrcode {
    display: inline-block;
    line-height: 0;
}

#qrcode canvas,
#qrcode img {
    border-radius: 8px;
    display: block !important;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    /* ✅ Laisser le canvas à sa taille native sans forcer quoi que ce soit */
}
/* ✅ Force les dimensions natives du canvas */
#qrcode canvas[width] {
    width: attr(width px) !important;
    height: attr(height px) !important;
}
.qr-placeholder {
    color: #999;
    text-align: center;
}

.qr-placeholder-icon {
    font-size: 3.5rem;
    color: #e0e0e0;
    margin-bottom: 12px;
}

.qr-placeholder-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.download-section {
    display: none;
}

.download-section.active {
    display: block;
}

.download-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.btn-download {
    background: white;
    color: #000;
    border: 2px solid #000;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-download:hover {
    background: #000;
    color: white;
}

.btn-download.primary {
    background: #000;
    color: white;
}

.btn-download.primary:hover {
    background: #ff9320;
    color: #000;
    border-color: #ff9320;
}

.info-box {
    background: #fffef5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box ul {
    margin: 0;
    padding-left: 18px;
}

.info-box li {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
}

.qr-stats {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 13px;
    font-weight: 700;
    color: #000;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #000000;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    .preview-section {
        position: relative;
        top: 0;
        order: -1;
        max-height: none;
    }
    .form-section {
        max-height: none;
    }
    .types-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    .page-title {
        font-size: 1.5rem;
        margin-top: 50px;
    }
    .page-subtitle {
        font-size: 0.95rem;
    }
    .form-section,
    .preview-section {
        padding: 25px 20px;
        border-radius: 10px;
    }
    .section-title,
    .preview-title {
        font-size: 1rem;
        padding: 8px 18px;
    }
    .types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .type-card {
        padding: 10px 6px;
    }
    .type-icon {
        font-size: 1.3rem;
    }
    .type-name {
        font-size: 0.7rem;
    }
    .color-picker-group {
        grid-template-columns: 1fr;
    }
    .size-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    .download-buttons {
        grid-template-columns: 1fr;
    }
    .qr-preview {
        padding: 25px 20px;
        min-height: 300px;
    }
    .btn-generate {
        padding: 12px 28px;
        font-size: 13px;
    }
    .info-box {
        padding: 12px 18px;
    }
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.3rem;
    }
    .page-subtitle {
        font-size: 0.9rem;
    }
    .form-section,
    .preview-section {
        padding: 20px 15px;
    }
    .customization-section {
        padding: 15px;
    }
    .qr-preview {
        padding: 20px 15px;
        min-height: 280px;
    }
    .qr-placeholder-icon {
        font-size: 2.5rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn-generate,
    .btn-download,
    .btn-upload-logo,
    .type-card {
        min-height: 44px;
    }
}