/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background-color: #020817;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 650px;
}

/* ---------- BARRE DE NAVIGATION ---------- */
.browser-bar {
    background: #091530;
    padding: 10px 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    align-items: center;
    border: 1px solid #1a305d;
    border-bottom: none;
}

.dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot-red {
    background: #ff5f56;
}
.dot-yellow {
    background: #ffbd2e;
}
.dot-green {
    background: #27c93f;
}

.url-bar {
    background: #030a1c;
    color: #7b93be;
    font-size: 11px;
    padding: 4px 15px;
    border-radius: 12px;
    margin-left: 15px;
    flex-grow: 1;
    text-align: center;
    border: 1px solid #142544;
}

/* ---------- ZONE DU FLYER ---------- */
.flyer-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #040e24;
    border-left: 1px solid #1a305d;
    border-right: 1px solid #1a305d;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    user-select: none;
}

#flyerCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}
#flyerCanvas:active {
    cursor: grabbing;
}

/* ---------- PANNEAU DE CONTRÔLE ---------- */
.controls-panel {
    background: #091530;
    padding: 20px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #1a305d;
    border-top: none;
}

.adjust-tools {
    align-items: center;
    justify-content: space-between;
    background: #040e24;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #142544;
    display: none;
}

.adjust-tools label {
    font-size: 12px;
    font-weight: 700;
    color: #7b93be;
}

.adjust-tools input[type="range"] {
    width: 70%;
    accent-color: #ff9900;
    cursor: pointer;
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background-color: #ff9900;
    color: #051330;
}
.btn-primary:hover {
    background-color: #e68a00;
}

.btn-success {
    background-color: #27c93f;
    color: #051330;
}
.btn-success:disabled {
    background-color: #234433;
    color: #628a73;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---------- SPINNER DE CHARGEMENT ---------- */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid #051330;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-loading .btn-text {
    display: none;
}
.btn-loading .spinner {
    display: inline-block;
}
.btn-loading {
    pointer-events: none; /* bloque les clics supplémentaires */
}

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

.instructions {
    text-align: center;
    font-size: 11px;
    color: #7b93be;
    margin-top: 5px;
}
