.plant-identification-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.identification-header {
    text-align: center;
    margin-bottom: 40px;
}

.identification-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #2d8659;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.leaf-icon {
    font-size: 2.5rem;
    color: #2d8659;
}

.upload-area {
    border: 2px dashed #2d8659;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background-color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #1e6b47;
    background-color: #f8fff9;
}

.upload-area.dragging {
    border-color: #1e6b47;
    background-color: #f0fdf4;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: #2d8659;
    margin-bottom: 20px;
}

.upload-text {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-hint {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.select-photos-btn {
    background-color: #2d8659;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.select-photos-btn:hover {
    background-color: #1e6b47;
}

.file-input {
    display: none;
}

.preview-container {
    margin-top: 30px;
    display: none;
}

.preview-container.show {
    display: block;
}

.preview-title {
    font-size: 1.5rem;
    color: #2d8659;
    margin-bottom: 20px;
    font-weight: 600;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.preview-item:hover {
    transform: scale(1.05);
}

.preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}

.remove-image-btn:hover {
    background-color: rgba(185, 28, 28, 1);
}

.image-name {
    padding: 8px;
    background-color: #f7fafc;
    font-size: 0.85rem;
    color: #4a5568;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.image-category-select {
    width: 100%;
    padding: 4px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    transition: border-color 0.3s ease;
    height: 40px;
}

.image-category-select:focus {
    outline: none;
    border-color: #2d8659;
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.1);
}

.preview-item-footer {
    padding: 8px;
    background-color: #f7fafc;
}

.identify-btn,
.clear-btn {
    background-color: #2d8659;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 20px;
    min-width: 160px;
    justify-content: center;
}

.identify-btn:hover:not(:disabled) {
    background-color: #1e6b47;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.3);
}

.identify-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    opacity: 0.7;
}

.clear-btn {
    background-color: #e53e3e;
}

.clear-btn:hover:not(:disabled) {
    background-color: #c53030;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.clear-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    opacity: 0.7;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-container {
    margin-top: 40px;
    display: none;
}

.result-container.show {
    display: block;
}

.result-header {
    background: linear-gradient(135deg, #2d8659 0%, #1e6b47 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-header i {
    font-size: 1.5rem;
}

.result-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: white;
}

.result-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.result-section-title {
    padding: 20px 30px;
    background-color: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d8659;
}

.result-section-content {
    padding: 20px 30px;
}

.image-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.image-info-item:last-child {
    border-bottom: none;
}

.image-info-name {
    color: #4a5568;
    font-size: 0.95rem;
}

.image-info-organ {
    background-color: #2d8659;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.species-result {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.species-result:last-child {
    border-bottom: none;
}

.species-result:hover {
    background-color: #f7fafc;
}

.species-result.best-match {
    background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 100%);
    border-left: 4px solid #2d8659;
}

.species-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.species-info {
    flex: 1;
}

.species-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.species-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d8659;
    margin-bottom: 4px;
}

.species-name-latin {
    font-style: italic;
    color: #718096;
    font-size: 0.95rem;
}

.species-score {
    background: linear-gradient(135deg, #2d8659 0%, #1e6b47 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.species-score.best {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    display: flex;
    align-items: center;
    gap: 6px;
}

.species-classification {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.classification-item {
    font-size: 0.9rem;
    color: #4a5568;
}

.classification-label {
    font-weight: 600;
    color: #2d8659;
}

.classification-value {
    margin-left: 4px;
}

.common-names {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.common-name-tag {
    background-color: #e6f7f0;
    color: #2d8659;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.view-detail-btn {
    margin-top: 12px;
    background-color: #2d8659;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.view-detail-btn:hover {
    background-color: #1e6b47;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.3);
    color: white;
    text-decoration: none;
}

.error-message {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.success-message {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
}

.action-buttons {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.custom-modal-overlay.show {
    display: flex;
}

.custom-modal {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d8659;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.custom-modal-close:hover {
    background-color: #f7fafc;
    color: #2d8659;
}

.custom-modal-body {
    padding: 24px;
}

.custom-modal-message {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.custom-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.custom-modal-btn-cancel {
    background-color: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.custom-modal-btn-cancel:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
}

.custom-modal-btn-confirm {
    background-color: #e53e3e;
    color: white;
}

.custom-modal-btn-confirm:hover {
    background-color: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

@media (max-width: 768px) {
    .species-result {
        flex-direction: column;
    }

    .species-image {
        width: 100%;
        height: 200px;
    }

    .species-header {
        flex-direction: column;
        gap: 12px;
    }

    .species-classification {
        grid-template-columns: 1fr;
    }

    .identification-header h1 {
        font-size: 2rem;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

