/* ========================
   STYLE GLOBAL
======================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 10px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-weight: bold;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    padding: 10px 15px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

.error {
    text-align: center;
    color: #dc3545;
    font-weight: bold;
    margin-top: 10px;
}

/* ========================
   HEADER
======================== */
.main-header {
    background: #222;
    color: white;
    padding: 10px 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.main-nav li {
    line-height: 30px;
}

.main-nav a {
    color: white;
    text-decoration: none;
}

.logout-btn {
    background: #c0392b;
    border: none;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.token-badge {
    background: #f39c12;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
}
/* ========================
   SECTION AUTH
======================== */

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-switch {
    display: flex;
    background: #f1f3f5;
    border-radius: 50px;
    padding: 5px;
    width: fit-content;
    margin: 0 auto 25px;
}

.auth-switch button {
    border: none;
    background: transparent;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #555;
}

.auth-switch button:hover {
    color: #000;
}

.auth-switch button.active {
    background: #2d6cdf;
    color: #fff;
    box-shadow: 0 4px 10px rgba(45,108,223,0.3);
}

/* ========================
   SECTION UPLOAD
======================== */
.upload-section {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* ========================
   BLOCS D'IMAGES
======================== */
.block {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.left-panel .main-image-container {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.left-panel .main-image-container img.main-image {
    max-width: 100%;
    max-height: 280px;
    border: 1px solid #ccc;
    border-radius: 5px;
    object-fit: contain;
    margin-bottom: 10px;
}

.right-panel {
    width: 200px;
}

.right-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.right-panel li {
    padding: 8px 5px;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
    transition: background 0.2s, color 0.2s;
}

.right-panel li.active {
    background: #007bff;
    color: white;
    font-weight: bold;
    border-radius: 4px;
}

/* ========================
   BOUTONS
======================== */
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.button-container button {
    flex: 1 1 auto;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #fff;
}

.image-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.image-buttons button {
    flex: 1 1 auto;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #fff;
}

/* Types de boutons */
.editButton { background-color: #28a745; color: white; border-radius: 5px; }
.editButton:hover { background-color: #1e7e34; }

.copyUrlButton { background-color: #007BFF; color: white; border-radius: 5px; }
.copyUrlButton:hover { background-color: #0056b3; }

.deleteButton { background-color: #dc3545; color: white; border-radius: 5px; }
.deleteButton:hover { background-color: #a71d2a; }

/* ========================
   MODAL CROPPER
======================== */
#modalEditor {
    display: none;
    position: fixed;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#modalEditor .modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

#modalEditor .modal-content img {
    max-width: 600px;
    max-height: 80vh;
    border-radius: 5px;
}

#modalEditor .modal-content button {
    margin: 5px;
}

/* ========================
   RESPONSIVE
======================== */
@media screen and (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 15px;
    }

    /*.right-panel {
        width: 100%;
    }*/

    .left-panel img.main-image {
        max-height: 300px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 10px;
    }

    h1 { font-size: 1.4rem; }

    .left-panel img.main-image {
        max-height: 200px;
    }

    button {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .right-panel li {
        padding: 6px 5px;
    }
}