/* Styles spécifiques pour les outils d'image */

/* Styles pour le conteneur de résultats */
.result-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: #222;
    border: 1px solid #444;
    color: #fff;
}

/* Styles pour la grille de résultats */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Styles pour les cartes d'image */
.image-card {
    border: 1px solid #444;
    border-radius: 5px;
    overflow: hidden;
    background-color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
    color: #fff;
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Styles pour l'aperçu d'image */
.image-preview {
    height: 150px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #222;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Checkerboard background to visualize transparency */
.image-preview.checkerboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
                      linear-gradient(-45deg, #ccc 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #ccc 75%),
                      linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    z-index: 0;
}
.image-preview.checkerboard img {
    position: relative;
    z-index: 1;
}

/* Styles pour les informations d'image */
.image-info {
    padding: 10px;
}

.image-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.image-details {
    font-size: 0.8em;
    color: #aaa;
}

.image-details span {
    display: block;
    margin-bottom: 2px;
}

/* Styles pour le bouton de téléchargement */
.download-image-btn {
    width: 100%;
    padding: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.download-image-btn:hover {
    background-color: #2980b9;
}

/* Styles pour la liste de fichiers */
.file-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #222;
    color: #fff;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #444;
}

.file-item:last-child {
    border-bottom: none;
}

.file-preview {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    border-radius: 3px;
    overflow: hidden;
}

.file-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-info {
    flex-grow: 1;
    overflow: hidden;
}

.file-name {
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size, .file-type {
    font-size: 0.8em;
    color: #aaa;
    margin-right: 10px;
}

.remove-file {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.remove-file:hover {
    background-color: #c0392b;
}

/* Styles pour les options de redimensionnement */
.resize-option {
    margin-top: 10px;
    padding: 10px;
    background-color: #222;
    border-radius: 5px;
    border: 1px solid #444;
}

/* Styles pour le modal de téléchargement */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.download-modal-content {
    background-color: #222;
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    border: 1px solid #444;
}

.download-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.download-item {
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    position: relative;
    background-color: #333;
}

.download-item img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 5px;
}

.download-item label {
    display: block;
    cursor: pointer;
}

.download-item span {
    display: block;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-single {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Styles pour les états de traitement */
.processing {
    border-color: #3498db;
}

.success {
    border-color: #2ecc71;
}

.error {
    border-color: #e74c3c;
}

/* Styles pour le message de statut */
.status-message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 5px;
    background-color: #333;
    text-align: center;
    color: #fff;
}

/* Loading state for status message */
.status-message.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Minimal spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
    display: inline-block;
}

@keyframes spinner-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Styles pour la zone de glisser-déposer */
.upload-area {
    border: 2px dashed #3498db;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s;
    background-color: #222;
    color: #fff;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #2980b9;
    background-color: #333;
}

.upload-area i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 10px;
}

/* Styles pour les options */
.options-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #252525;
    border-radius: 5px;
    border: 1px solid #444;
    color: #fff;
}

.option-group {
    margin-bottom: 15px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.option-group select, .option-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
}

.option-group input[type="range"] {
    width: 80%;
    vertical-align: middle;
}

.option-group span {
    display: inline-block;
    width: 15%;
    text-align: right;
}

/* Styles pour les boutons d'action */
.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.action-buttons.centered {
    justify-content: center;
}

.action-btn.primary {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn.primary:hover {
    background-color: #2980b9;
}

.action-btn.secondary {
    background-color: #555;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn.secondary:hover {
    background-color: #444;
}

/* Styles responsifs */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .download-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .download-list {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Styles for lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: #222;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    z-index: 1010;
}

.lightbox-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-caption {
    text-align: center;
    font-size: 1.1em;
    padding: 10px 0;
}

/* Make preview images clickable */
.preview-image {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.preview-image:hover {
    transform: scale(1.05);
}

/* Make favicon result container scrollable */
#favicon-result .results-grid {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}
