/* Design Moderne et Sombre */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Archivo Narrow', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #121212;
  color: #e0e0e0;
}

html {
  background: #121212;
}

.alert {
  background-color: rgba(220, 53, 69, 0.2);
  border: 1px solid #dc3545;
  border-radius: 8px;
  padding: 15px;
  margin: 20px auto;
  width: 90%;
  max-width: 800px;
  color: #ffcdd2;
  font-size: 1.1em;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.info-drag {
    background-color: rgba(23, 162, 184, 0.2);
    border: 1px solid #17a2b8;
    border-radius: 8px;
    padding: 12px;
    margin: 20px 0;
    color: #b8daff;
    text-align: center;
    font-size: 1em;
    width: 100%;
}

.container {
    width: 95%;
    max-width: 1000px;
    margin: 30px auto;
    background-color: #1E1E1E;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 30px;
    border: 1px solid #333;
}

.upload_form_cont {
    color: #e0e0e0;
    width: 100%;
}

#dropArea {
    background-color: #252525;
    border: 2px dashed #444;
    border-radius: 12px;
    font-size: 1.5em;
    color: #aaa;
    padding: 60px 20px;
    margin: 20px 0;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

#dropArea i {
    font-size: 3em;
    margin-bottom: 20px;
    color: #555;
    transition: color 0.3s;
}

#dropArea:hover {
    background-color: #2a2a2a;
    border-color: #666;
    color: #fff;
}

#dropArea:hover i {
    color: #fff;
}

#dropArea.hover {
    background-color: #333;
    border-color: #4CAF50;
    transform: scale(1.01);
}

#dropArea.uploading {
    background: #252525 url(loading.gif) center center no-repeat;
    background-size: 50px;
}

#formGif {
  width: 100%;
  text-align: center;
  margin-top: 30px;
}

#formGif > div {
    margin-bottom: 20px;
}

label {
    color: #bbb;
    margin-bottom: 5px;
    display: inline-block;
}

input[type="text"] {
    background-color: #2C2C2C;
    padding: 15px;
    font-size: 1em;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    width: 100%;
    max-width: 300px;
    text-align: center;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4CAF50;
}

input[type="text"]::placeholder {
    color: #666;
}

#submitButton {
  display: none;
  background-color: #4CAF50;
  color: white;
  padding: 15px 50px;
  font-size: 1.1em;
  border: none;
  border-radius: 50px;
  margin: 30px auto;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
}

#submitButton:hover {
  background-color: #45a049;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* Zone de résultat / Liste d'images */
#result {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 40px;
  width: 100%;
}

#result > div {
    background-color: #2C2C2C;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.9em;
    color: #ddd;
    display: flex;
    align-items: center;
    cursor: grab;
    transition: background-color 0.2s, transform 0.2s;
    border: 1px solid #333;
}

#result > div:active {
    cursor: grabbing;
    transform: scale(0.98);
}

#result > div:hover {
    background-color: #383838;
    border-color: #555;
}

#result img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    background-color: #000;
}

/* Styles pour les détails du fichier (ajouté pour upload.php) */
.file-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.file-details p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-details .filename {
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.file-details .meta {
    font-size: 0.8em;
    color: #888;
}

/* Classe pour l'élément fantôme lors du drag */
.blue-background-class {
    background-color: rgba(76, 175, 80, 0.2) !important;
    border: 2px dashed #4CAF50;
    opacity: 0.8;
}

.info {
    margin-top: 20px;
    text-align: center;
    color: #888;
}

canvas {
    width: 100%;
    max-width: 500px;
    height: 6px;
    margin-bottom: 15px;
    border-radius: 3px;
    background-color: #333;
}

/* Page de résultat GIF */
.container-gif {
    background-color: #1E1E1E;
    padding: 40px;
    border-radius: 16px;
    margin: 40px auto;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid #333;
}

.finalGif {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background-color: #000;
}

.downloadButton {
    display: inline-block;
    background-color: #2196F3;
    color: white;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    margin-top: 40px;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.downloadButton:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.backlink {
    display: inline-block;
    margin-top: 30px;
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9em;
}

.backlink:hover {
    color: #fff;
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 15px;
        box-shadow: none;
    }
    
    #dropArea {
        font-size: 1.2em;
        padding: 40px 10px;
    }
    
    #result {
        grid-template-columns: 1fr;
    }
    
    .alert {
        width: 95%;
        font-size: 1em;
    }
}