/* pour la parti modification annonce */

.headeri {
  background: white;
  padding: 15px 20px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.headeri h1 {
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.headeri-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: normal;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  background: white;
}

.btn-primary {
  background-color: var(--principal);
  color: white;
  border-color: var(--principal);
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
}

.btn-success {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

.btn-success:hover {
  background-color: #1e7e34;
  border-color: #1e7e34;
}

/* Layout */

.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form sections */
.form-section {
  background: white;
  border: 1px solid #ddd;
  padding: 20px;
}

.form-section h2 {
  color: #333;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

/* Characteristics grid */
.characteristics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.characteristics-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my {
  margin: 10px 0;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--principal);
}

.checkbox-group label {
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 0;
  color: #333;
}

/* Equipment grid */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.equipment-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Photo upload section */
.photo-upload-section {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 4px;
  padding: 30px;
  text-align: center;
  transition: border-color 0.3s ease;
  background: #fafafa;
}

.upload-area:hover {
  border-color: var(--principal);
  background: #f8f9ff;
}

.file-input {
  display: none;
}

.upload-label {
  cursor: pointer;
  display: block;
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.upload-hint {
  color: #666;
  font-size: 12px;
  margin-top: 5px;
}

/* Description editor */
.description-editor {
  border: 1px solid #ddd;
  border-radius: 3px;
  overflow: hidden;
}

.editor-toolbar {
  background: #f8f9fa;
  padding: 8px;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 4px;
}

.toolbar-btn {
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: #e9ecef;
}

.description-textarea {
  border: none;
  border-radius: 0;
  width: 100%;
  min-height: 150px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  padding: 10px;
}

/* Responsive design */
@media (max-width: 1024px) {
  .characteristics-grid,
  .equipment-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .headeri {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .headeri-actions {
    width: 100%;
    justify-content: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .characteristics-grid,
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 15px;
  }

  .upload-area {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .headeri h1 {
    font-size: 16px;
  }

  .form-section h2 {
    font-size: 14px;
  }

  .upload-area {
    padding: 15px;
  }

  .upload-icon {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
  }
}

/* Hover effects */
.checkbox-group:hover {
  background-color: #f8f9fa;
  border-radius: 3px;
  padding: 2px;
  margin: -2px;
}

.upload-area:hover .upload-icon {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* radio */

.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-container {
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 18px;
  user-select: none;
  display: flex;
  align-items: center;
  transition: background 0.3s, color 0.3s;
}

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  left: 10px;
  height: 20px;
  width: 20px;
  background-color: #eee;
  border-radius: 50%;
  border: 2px solid #ccc;
}

.radio-container input:checked ~ .checkmark {
  background-color: var(--principal);
  border-color: var(--principal);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked ~ .checkmark:after {
  display: block;
}

.radio-container .checkmark:after {
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

@media (max-width: 500px) {
  .radio-group {
    flex-direction: column;
    gap: 10px;
  }

  .radio-container {
    width: 100%;
    justify-content: flex-start;
  }
}

 .uploadedtof {
        position: relative;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s;
    }

    .uploadedtof:hover {
        transform: translateY(-3px);
    }

    .uploadedtof img {
        width: 100%;
        height: 120px;
        object-fit: cover;
    }

    .uploadedtof .card-actions {
        display: flex;
        justify-content: space-between;
        padding: 8px;
        background: #fafafa;
        border-top: 1px solid #eee;
    }

    .uploadedtof .btn-update,
    .uploadedtof .btn-delete {
        flex: 1;
        margin: 0 2px;
        padding: 4px 6px;
        font-size: 12px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.2s;
    }

    .uploadedtof .btn-update {
        background: #ffa500;
        /* orange */
        color: white;
    }

    .uploadedtof .btn-update:hover {
        background: #e69500;
    }

    .uploadedtof .btn-delete {
        background: #e74c3c;
        /* rouge */
        color: white;
    }

    .uploadedtof .btn-delete:hover {
        background: #c0392b;
    }



        /* nouveau style de detail modal */

        .containerDetail {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
            text-align: center;
        }

        .containerDetail h1 {
            font-size: 2.5rem;
            margin-bottom: 30px;
            color: #2c3e50;
        }

        .open-btndx {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            font-size: 1.1rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        .open-btndx:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        /* Modaldx Styles */
        .modaldx {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
    	    backdrop-filter: blur(5px);
            animation: fadeIn 0.3s ease;
        }

        .modaldx.show {
            display: block;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .modaldx-content {
            background-color: white;
            margin: 20px auto;
            padding: 0;
            border-radius: 12px;
            width: 95%;
            max-width: 1000px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .modaldx-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 30px;
            border-bottom: 1px solid #eee;
            background-color: #fafafa;
            border-radius: 12px 12px 0 0;
        }

        .modaldx-header h2 {
            font-size: 1.5rem;
            color: #2c3e50;
            font-weight: 600;
        }

        .close-btndx {
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: #666;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .close-btndx:hover {
            background-color: #f0f0f0;
            color: #333;
        }

        .photo-griddx {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 20px;
            padding: 30px;
        }

        .photo-itemdx {
            position: relative;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            background-color: white;
        }

        .photo-itemdx:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .photo-itemdx img {
            width: 100%;
            height: 200px;
            object-fit: cover;
            display: block;
        }

        .photo-actionsdx {
            position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex
;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .photo-itemdx:hover .photo-actionsdx {
            opacity: 1;
        }

        .action-btndx {
            background: rgba(255, 255, 255, 0.9);
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .view-btndx:hover {
               transform: scale(1.1);
    background: #faa72c;
    color: var(--white);
        }

        .delete-btndx:hover {
            background-color: #e74c3c;
            color: white;
        }

        .action-btndx svg {
            width: 16px;
            height: 16px;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .containerDetail {
                padding: 20px 15px;
            }

            .containerDetail h1 {
                font-size: 2rem;
            }

            .modaldx-content {
                margin: 10px;
                width: calc(100% - 20px);
                max-height: 95vh;
            }

            .modaldx-header {
                padding: 15px 20px;
            }

            .modaldx-header h2 {
                font-size: 1.3rem;
            }

            .photo-griddx {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
                gap: 15px;
                padding: 20px;
            }

            .photo-itemdx img {
                height: 180px;
            }
        }

        @media (max-width: 480px) {
            .photo-griddx {
                grid-template-columns: 1fr;
                gap: 15px;
                padding: 15px;
            }

            .photo-itemdx img {
                height: 200px;
            }

            .modaldx-header {
                padding: 12px 15px;
            }

            .open-btndx {
                padding: 12px 24px;
                font-size: 1rem;
            }
        }

        /* Smooth scrolling for modaldx */
        .modaldx-content {
            scroll-behavior: smooth;
        }

        /* Custom scrollbar for modaldx */
        .modaldx-content::-webkit-scrollbar {
            width: 8px;
        }

        .modaldx-content::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        .modaldx-content::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }

        .modaldx-content::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }


.share-cont {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    transition: background-color 0.3s, transform 0.2s;
    cursor: pointer;
}

.share-cont i {
    font-size: 20px;
    color: #1c2241;
}

.share-cont a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    flex: 1;
}

.share-cont:hover {
    background-color: #e6f0ff;
    transform: translateY(-2px);
}

.share-cont a:hover {
    color: #1c2241;
}
