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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #050505;
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
}

header {
    background: linear-gradient(to bottom, #111, #050505);
    padding: 1rem 2rem;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-title-section {
    flex: 1;
    min-width: 0;
    /* Permet le troncage si nécessaire */
}

.header-title-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, #fff, #888);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-desc {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header nav a,
header nav button {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

header nav a:hover,
header nav button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #555;
    transform: translateY(-2px);
}

header nav a.active {
    background: #fff;
    color: #000;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
}

/* Galerie et Albums */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.vignette {
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    background-color: #0c0c0c;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #1a1a1a;
}

.vignette:hover {
    transform: translateY(-5px);
    border-color: #333;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.vignette img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.vignette:hover img {
    transform: scale(1.08);
}

.vignette h3 {
    padding: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    background: #0c0c0c;
    border-top: 1px solid #1a1a1a;
}

/* Album Card Specific */
.album-card {
    display: flex;
    flex-direction: column;
}

.album-preview {
    position: relative;
    height: 300px;
    background: #111;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    font-weight: 800;
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.5rem;
}

.album-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #0c0c0c;
    position: relative;
    min-height: 80px;
}

.album-titre-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.album-titre-group h3 {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font-size: 1.1rem;
    text-align: left;
}

.photo-count {
    font-size: 0.75rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-weight: 600;
}

.album-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 50%;
}

.btn-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon.delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 2rem;
    background: #0c0c0c;
    border-radius: 20px;
    border: 2px dashed #1a1a1a;
}

.empty-state p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: #fff;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.edit-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10;
}

.vignette:hover .edit-icon {
    opacity: 1;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.close-modal-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s;
    z-index: 1001;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s;
    flex-shrink: 0;
}

.nav-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.1;
    cursor: default;
}

.slider-container {
    position: relative;
    width: 100%;
    flex-shrink: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.image-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

#image-apres-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0);
    pointer-events: none;
}

#slider-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #fff;
    cursor: ew-resize;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 5;
}

#slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    border: 4px solid #000;
    cursor: ew-resize;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
}

#slider-handle::before,
#slider-handle::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

#slider-handle::before {
    border-right: 8px solid #000;
    margin-right: 4px;
}

#slider-handle::after {
    border-left: 8px solid #000;
    margin-left: 4px;
}

#modal-titre {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
}

.modal-content-small {
    background: #0c0c0c;
    padding: 3rem;
    border-radius: 8px;
    width: 100%;
    max-width: 550px;
    border: 1px solid #1a1a1a;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9);
    position: relative;
}

.modal-content-small h2 {
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

/* Forms */
.form-container {
    max-width: 850px;
    margin: 0 auto;
    background: #0c0c0c;
    padding: 4rem;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.form-group {
    margin-bottom: 2.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1.25rem;
    background-color: #111;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #444;
    background-color: #161616;
}

.upload-zones {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.upload-zone {
    background-color: #111;
    border: 2px dashed #1a1a1a;
    border-radius: 8px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.upload-zone.drag-over {
    border-color: #fff;
    background-color: #1a1a1a;
    transform: scale(1.02);
}

.upload-zone:hover:not(.drag-over) {
    border-color: #333;
    background-color: #141414;
}

.upload-zone label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    color: #444;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.upload-zone:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone label,
.btn-browse {
    position: relative;
    z-index: 10;
}

.btn-browse {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.upload-zone:hover .btn-browse {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
}

.upload-zone .preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.upload-zone .preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    /* Un peu transparent pour voir le texte si besoin, ou 1 au survol */
    transition: opacity 0.3s;
}

.upload-zone:hover .preview img {
    opacity: 0.4;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3.5rem;
}

.btn-submit,
.btn-primary {
    padding: 1rem 3rem;
    background: #fff;
    color: #000;
    border: 1px solid #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-submit:hover,
.btn-primary:hover {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: #1a1a1a;
    color: #888;
    border: 1px solid #222;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

.btn-delete {
    padding: 1rem 2rem;
    background: rgba(255, 68, 68, 0.05);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: auto;
}

.btn-delete:hover {
    background: #ff4444;
    color: #fff;
    border-color: #ff4444;
    transform: translateY(-2px);
}

.message {
    margin-top: 2.5rem;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: rgba(10, 50, 10, 0.3);
    color: #7f7;
    border: 1px solid rgba(0, 255, 0, 0.1);
}

.message.error {
    background: rgba(50, 10, 10, 0.3);
    color: #f77;
    border: 1px solid rgba(255, 0, 0, 0.1);
}

.upload-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.save-ordre-btn {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    padding: 1.5rem 3rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 16px;
    font-weight: 800;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 100;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.save-ordre-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

/* Utils */
.ordre-mode {
    cursor: move !important;
}

.dragging {
    opacity: 0.3;
    transform: scale(0.9);
}

.drag-over-vignette {
    border-color: #fff !important;
    background: #1a1a1a !important;
}

@media (max-width: 1024px) {
    .galerie {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .header-title-section {
        width: 100%;
    }

    .header-title-section h1 {
        font-size: 1.5rem;
    }

    .galerie {
        grid-template-columns: 1fr;
    }

    .upload-zones {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 2rem 1.5rem;
    }

    .nav-arrow {
        display: none;
    }

    .modal-content {
        gap: 0;
    }
}