@font-face {
    font-family: 'Daniel';
    src: url('daniel/Daniel-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Daniel';
    src: url('daniel/Daniel-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Daniel';
    src: url('daniel/Daniel-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

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

:root {
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-400: #a8a29e;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-800: #292524;
    --stone-900: #1c1917;
    --stone-950: #0c0a09;
}

html, body {
    height: 100%;
    overflow: hidden; /* Pas de scroll */
}

body {
    padding-bottom: 20px;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    background: white;
}

.postcard-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.buttons-container:first-child .flip-button {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

.flip-card {
    perspective: 1000px;
    opacity: 0;
    transform: translateY(100vh);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card-inner.flipped {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    overflow: visible;
}

.flip-card-front {
    transform: rotateY(0deg);
    z-index: 1;
}

.flip-card-back {
    transform: rotateY(180deg);
    z-index: 1;
}

.flip-card-back.postcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(kiwihug-zGZYQQVmXw0-unsplash.jpg);
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: 0;
}

.flip-card-back .back-centered-image {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    width: calc(100% - 80px);
    height: calc(100% - 80px);
    object-fit: cover;
    z-index: 1;
}

/* Format A6 horizontal : 148mm x 105mm (ratio ~1.41:1) */
.postcard {
    background: #FFFFFD;
    box-shadow: 2px 3px 7px rgba(0, 0, 0, 0.12), 0px 4px 250px rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flip-card-front.postcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(kiwihug-zGZYQQVmXw0-unsplash.jpg);
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: 0;
}

.text-boxes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    overflow: visible !important;
}

.text-box {
    position: absolute;
    min-width: 100px;
    min-height: 50px;
    padding: 10px;
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 8px;
    cursor: text;
    pointer-events: all;
    word-wrap: break-word;
    z-index: 1; /* Sous le timbre */
    overflow-wrap: break-word;
    white-space: pre-wrap;
    overflow: visible !important;
    font-family: 'Daniel', 'Patrick Hand', cursive;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    outline: none;
    resize: none;
    height: auto;
    transform-style: flat !important;
    isolation: isolate;
}

.text-box:focus {
    border-color: rgba(255, 0, 195, 0.7);
    background: rgba(255, 0, 195, 0.05);
}

.text-box.active {
    border-color: rgba(255, 0, 195, 0.7);
    background: rgba(255, 0, 195, 0.05);
}

.text-box:empty:not(:focus):before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

/* Nouvelle approche : handles dans un container séparé */
.text-box-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.text-box-handles.visible {
    opacity: 1;
    visibility: visible;
}

.text-box-handles .handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid #FF00C3;
    pointer-events: all;
    z-index: 10000;
}

.text-box-handles .handle:hover {
    background: rgba(255, 0, 195, 0.3);
    transform: scale(1.2);
}

.text-box-handles .handle-rotate {
    border-radius: 50%;
    cursor: grab;
}

.text-box-handles .handle-rotate:active {
    cursor: grabbing;
}

.text-box-handles .bin-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    left: -8px;
    top: -8px;
    cursor: pointer;
    pointer-events: all;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s, visibility 0.2s;
}

.text-box-handles .bin-icon:hover {
    opacity: 0.8;
}

/* Barre d'outils de formatage */
.text-format-toolbar {
    position: absolute;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    gap: 12px;
    width: auto;
    min-height: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--stone-100);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: all;
    box-sizing: border-box;
    overflow: visible;
}

.text-format-toolbar.visible {
    opacity: 1;
    visibility: visible;
}

.text-format-toolbar .color-picker {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.text-format-toolbar .color-option {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    position: relative;
    box-shadow: 0 0 0 1px transparent;
}

.text-format-toolbar .color-option:hover {
    transform: scale(1.2);
}

.text-format-toolbar .color-option.active {
    box-shadow: 0 0 0 1px white;
}

.text-format-toolbar .color-option.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid white;
    pointer-events: none;
    z-index: 1;
}

.text-format-toolbar .color-option.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--active-color, #000000);
    pointer-events: none;
    z-index: 0;
}

.text-format-toolbar .font-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 10003;
}

.text-format-toolbar .font-selector:hover {
    background: #f5f5f5;
}

.text-format-toolbar .font-selector .chevron {
    width: 12px;
    height: 12px;
    color: var(--stone-600);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.text-format-toolbar .font-selector:hover .chevron {
    color: var(--stone-700);
}


.text-format-toolbar .font-selector .font-name {
    font-family: inherit;
    font-weight: 600;
}

.text-format-toolbar .font-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10004;
    min-width: 150px;
    display: none;
    overflow: hidden;
    padding: 4px;
    flex-direction: column;
    gap: 4px;
}

.text-format-toolbar .font-dropdown.visible {
    display: flex;
}

.text-format-toolbar .font-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    border-radius: 10px;
    margin: 0;
}

.text-format-toolbar .font-option:hover {
    background: var(--stone-100);
}

.text-format-toolbar .font-option.active {
    background: var(--stone-100);
    font-weight: 600;
}

.text-format-toolbar .font-size-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.text-format-toolbar .font-size-controls button {
    width: auto;
    height: 24px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0 2px;
    margin: 0;
}

.text-format-toolbar .font-size-controls button:hover {
    background: white;
}

.text-format-toolbar .font-size-display {
    min-width: 30px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 0 8px;
}

.lines-svg {
    position: absolute;
    bottom: 100px;
    right: 40px;
    width: 200px;
    height: auto;
    z-index: 1;
}

/* Sticker Peel Effect */
.sticker-peel-container {
    position: absolute;
    top: 25px;
    right: 7px;
    width: 131px;
    height: auto;
    z-index: 10005; /* Au-dessus des textes et images */
    z-index: 2;
    cursor: pointer;
    transform: rotate(225deg);
    transform-origin: center;
}

.sticker-filters {
    position: absolute;
    width: 0;
    height: 0;
    visibility: hidden;
}

.sticker-main {
    position: relative;
    clip-path: polygon(-10px -10px, calc(100% + 10px) -10px, calc(100% + 10px) calc(100% + 10px), -10px calc(100% + 10px));
    transition: clip-path 0.6s ease-out;
    filter: url(#stickerDropShadow);
}

.sticker-lighting {
    filter: url(#stickerPointLight);
}

.sticker-image {
    width: 131px;
    height: auto;
    display: block;
    transform: rotate(-225deg);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.sticker-flap {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: calc(-100% - 20px);
    clip-path: polygon(-10px -10px, calc(100% + 10px) -10px, calc(100% + 10px) -10px, -10px -10px);
    transform: scaleY(-1);
    transition: all 0.6s ease-out;
    pointer-events: none;
}

.flap-lighting {
    filter: url(#stickerPointLightFlipped);
}

.flap-image {
    width: 131px;
    height: auto;
    display: block;
    transform: rotate(-225deg);
    filter: url(#stickerExpandAndFill);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.sticker-peel-container:hover .sticker-main {
    clip-path: polygon(-10px 40%, calc(100% + 10px) 40%, calc(100% + 10px) calc(100% + 10px), -10px calc(100% + 10px));
}

.sticker-peel-container:hover .sticker-flap {
    clip-path: polygon(-10px -10px, calc(100% + 10px) -10px, calc(100% + 10px) 40%, -10px 40%);
    top: calc(-100% + 80% - 1px);
}

.sticker-peel-container:active .sticker-main {
    clip-path: polygon(-10px 40%, calc(100% + 10px) 40%, calc(100% + 10px) calc(100% + 10px), -10px calc(100% + 10px));
}

.sticker-peel-container:active .sticker-flap {
    clip-path: polygon(-10px -10px, calc(100% + 10px) -10px, calc(100% + 10px) 40%, -10px 40%);
    top: calc(-100% + 80% - 1px);
}

.frame-svg {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 70px;
    height: auto;
    z-index: 1;
}

.vertical-line-svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 75%;
    width: 1px;
    z-index: 1;
}

/* Desktop : positionnement avec espacement égal */
@media (min-width: 768px) {
    .vertical-line-svg {
        right: 280px; /* 40px (bord) + 200px (lignes pointillées) + 40px (espace) */
    }
}

/* Mobile : positionnement proportionnel */
@media (max-width: 767px) {
    .vertical-line-svg {
        right: calc(40px + 200px + 40px);
    }
}

/* Desktop : taille A6 fixe */
@media (min-width: 768px) {
    .flip-card {
        width: 595px;  /* ~148mm à 96dpi */
        height: 420px; /* ~105mm à 96dpi */
    }
    
    .postcard {
        width: 595px;
        height: 420px;
    }
}

/* Mobile : fit l'écran avec padding */
@media (max-width: 767px) {
    .flip-card {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px - 80px); /* Soustraire l'espace pour le bouton */
        max-width: 100%;
        max-height: calc(100vh - 80px);
    }
    
    .postcard {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px - 80px);
        max-width: 100%;
        max-height: calc(100vh - 80px);
    }
}

.buttons-container {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-button {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 90px;
    height: 40px;
    padding: 0 8px;
    background: var(--stone-100);
    color: var(--stone-600);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10006; /* Au-dessus de tout */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.flip-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.flip-button-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.flip-button svg {
    display: inline-block;
}

.flip-button.rotating svg,
.flip-button.rotating .flip-button-text {
    animation: rollVertical 0.3s ease;
}

@keyframes rollVertical {
    0% {
        transform: translateY(0) rotateX(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) rotateX(90deg);
        opacity: 0;
    }
    51% {
        transform: translateY(20px) rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotateX(0deg);
        opacity: 1;
    }
}

.flip-button:hover {
    background: var(--stone-200);
}

.flip-button:active {
    background: var(--stone-300);
}

.face-b-button,
.write-text-button,
.scan-button {
    padding: 12px 20px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    background: var(--stone-100);
    color: var(--stone-600);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    height: 44px;
    line-height: 1;
    min-width: fit-content;
    flex-shrink: 0;
}

.face-b-button svg,
.write-text-button svg,
.scan-button svg {
    /* display: block; */
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
}

.face-b-button,
.write-text-button,
.scan-button {
    text-align: center;
}
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.face-b-button:hover,
.write-text-button:hover,
.scan-button:hover {
    background: var(--stone-200);
}

.face-b-button:active,
.write-text-button:active,
.scan-button:active {
    background: var(--stone-300);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--stone-50);
    border: 1px solid var(--stone-100);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-title {
    padding: 0 0 15px;
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    color: #333;
    text-align: center;
}

/* Zone de drag & drop */
.drop-zone {
    margin: 20px 30px;
    border: 1px dashed var(--stone-300);
    border-radius: 12px;
    padding: 24px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--stone-100);
}

.drop-zone:hover {
    border-color: var(--stone-400);
    background: var(--stone-100);
}

.drop-zone.drag-over {
    border-color: var(--stone-600);
    background: var(--stone-100);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-content svg {
    color: var(--stone-500);
}

.drop-zone-content p {
    margin: 0;
    color: var(--stone-500);
    font-size: 16px;
}

/* Barre de recherche */
.search-container {
    margin: 20px 30px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--stone-200);
    border-radius: 12px;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--stone-500);
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 12px 16px 12px 48px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    background: white;
    color: #333;
    width: 100%;
}

.search-input::placeholder {
    color: var(--stone-400);
}

.search-input:focus {
    outline: none;
}

/* Résultats Unsplash */
.unsplash-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px 30px 30px;
}

.unsplash-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.unsplash-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loading,
.error {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.error {
    color: #d32f2f;
}

/* Container pour les images scannées */
.scanned-images-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    overflow: visible !important;
}

.scanned-image {
    position: absolute;
    cursor: move;
    pointer-events: all;
    z-index: 1; /* Sous le timbre */
    overflow: visible;
    border-radius: 8px;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.scanned-image img {
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    border-radius: 8px;
    border: 1px dashed transparent;
    transition: border 0.3s ease;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.scanned-image.selected img,
.scanned-image:hover img {
    border: 1px dashed rgba(255, 0, 195, 0.7);
}

.scanned-image.processing img {
    border: none;
}

.scanned-image-delete {
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10003;
    pointer-events: all;
    border: none !important;
}

.scanned-image:hover .scanned-image-delete,
.scanned-image.selected .scanned-image-delete {
    opacity: 1;
}

.scanned-image.processing .scanned-image-delete {
    opacity: 0 !important;
    pointer-events: none;
}

.image-resize-handle {
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10003;
    pointer-events: all;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.scanned-image:hover .image-resize-handle,
.scanned-image.selected .image-resize-handle {
    opacity: 1;
}

.scanned-image.processing .image-resize-handle {
    opacity: 0 !important;
    pointer-events: none;
}

.scanned-image.processing .image-rotate-handle {
    opacity: 0 !important;
    pointer-events: none;
}

/* Le handle de rotation est géré en JavaScript, mais on peut aussi ajouter un style CSS si nécessaire */

.image-toolbar {
    opacity: 0;
    transition: opacity 0.2s;
}

.scanned-image:hover .image-toolbar,
.scanned-image.selected .image-toolbar {
    opacity: 1;
}

.scanned-image.processing .image-toolbar {
    opacity: 0 !important;
    pointer-events: none;
}

.eraser-canvas {
    user-select: none;
    -webkit-user-select: none;
}

.eraser-cursor {
    transition: none;
    will-change: transform;
}

/* Overlay de traitement avec effet de reflet */
.processing-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 150%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.8) 40%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 0.3) 80%,
        transparent 100%
    );
    animation: shimmer 1.2s infinite;
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    filter: blur(2px);
}

@keyframes shimmer {
    0% {
        left: -150%;
    }
    100% {
        left: 100%;
    }
}

.scanned-image.processing {
    overflow: visible;
    position: relative;
}

.scanned-image.processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: pulse 2s infinite;
    z-index: 9;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.3;
    }
}

.processing-message {
    /* Les styles sont maintenant définis inline dans le JavaScript pour un positionnement précis */
}

.scanned-image.processing {
    overflow: visible;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.scanned-image.processing img {
    position: relative !important;
    overflow: hidden !important;
}

.scanned-image.processing {
    position: relative;
}

/* Styles pour le modal de scan */
.scan-description {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 0, 195, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 0, 195, 0.1);
}

.scan-description p {
    color: #57534e;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.scan-image-container {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.scan-text-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    display: block;
}

.scan-instructions {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

.scan-camera-button {
    width: 100%;
    padding: 15px;
    background: #FF00C3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.scan-camera-button:hover {
    background: #e600b3;
}

#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    padding: 12px;
    width: fit-content;
}

.scan-status {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    color: #666;
}


/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: calc(100% - 20px);
        margin: 10px;
    }
    
    .unsplash-results {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .unsplash-image {
        height: 100px;
    }
}

