/* ============================================================
   RESET + ANTI-ZOOM iPHONE
============================================================ */
input, button, textarea {
    font-size: 16px !important;
}

body {
    margin: 0;
    padding: 0;
    background: #f6f6f6;
    font-family: system-ui, sans-serif;
}

/* ============================================================
   GLOBAL CONTAINER
============================================================ */
#airphoto-app {
    padding: 20px;
    max-width: 700px;
    margin: auto;
}

/* Marges générales */
.step h2 {
    margin-bottom: 20px;
}

.step input {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

button {
    display: block;
    width: 100%;
    padding: 14px;
    background: #0E6121;
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 20px;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* ============================================================
   HEADER
============================================================ */
#airphoto-top-header {
    background: #ffffff;
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    align-items: center;
    margin-bottom: 20px;
}

#airphoto-top-header img {
    max-height: 70px;
}

#airphoto-top-header .right {
    flex: 1;
    text-align: right;
    padding-left: 20px;
}

.header-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* ============================================================
   STEPS
============================================================ */
.step {
    display: none;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

#step-1 {
    display: block;
}

.error {
    margin-top: -10px;
    margin-bottom: 20px;
    color: red;
    font-size: 14px;
}

/* ============================================================
   GRID MINIATURES
============================================================ */
#photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

/* Miniature individuelle */
.thumb-wrapper {
    position: relative;
    width: 95px;
    height: 95px;
}

.thumb {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
}

/* Bouton X */
.remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #d00000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    text-align: center;
    line-height: 24px;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,.2);
}

/* Carré + */
#add-photo-tile {
    width: 95px;
    height: 95px;
    background: #e2e2e2;
    color: #0E6121;
    font-size: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
}

/* ============================================================
   FULLSCREEN
============================================================ */
#fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

#fullscreen-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 20px;
}

#fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 42px;
    cursor: pointer;
}

/* ============================================================
   LOADER + PROGRESSION
============================================================ */
#loading-screen {
    display: none; /* caché au début */
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(3px);
    z-index: 999999;

    /* Ne pas activer ici → JS le fera */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


.loading-spinner {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 7px solid #ccc;
    border-top-color: #0E6121;
    animation: spin .9s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#progress-container {
    width: 80%;
    height: 16px;
    background: #ddd;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: #0E6121;
    transition: width .2s linear;
}

#progress-text {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #0E6121;
}

/* ============================================================
   ADMIN TABLE (FRONT DASHBOARD)
============================================================ */
#admin-table {
    margin-top: 20px;
}

#admin-table table {
    width: 100%;
    border-collapse: collapse;
}

#admin-table th {
    background: #0E6121;
    color: white;
    padding: 10px;
    text-align: left;
}

#admin-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.admin-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 6px;
    cursor: pointer;
}

/* Bouton ZIP et Supprimer */
#admin-table .button {
    background: #0E6121 !important;
    color: #fff;
    border-radius: 6px;
    padding: 6px 12px;
}

#admin-table .delete-lot {
    background: #b70000 !important;
    color: white;
}

/* ============================================================
   CHECK VALIDATION
============================================================ */
.check-animation {
    font-size: 90px;
    color: #0E6121;
    animation: appear .4s ease-out forwards;
}

@keyframes appear {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

#gallery-btn {
    background: #888;
}
#gallery-btn:hover {
    opacity: 0.9;
}

#code-error {
    margin-top: 10px;
    margin-bottom: 20px;
}

.back-btn {
    background: #777;
    margin-top: 10px;
}
.back-btn:hover {
    opacity: 0.9;
}

